| Q |
A |
| PHPUnit version |
9.2.1 |
| PHP version |
7.4.6 |
| Installation Method |
Composer |
Summary
After unlink variable of type resource assert assertIsNotResource detect value as resource.
Current behavior
IDE suggests to replace static::assertFalse to static::assertIsNotResource. I don`t know it is bug or specific. But it is not obvious for me.
How to reproduce
public function testUnlinkResource(): void
{
$resource = fopen('php://temp', 'r');
fclose($resource);
static::assertFalse(is_resource($resource)); // pass
static::assertIsNotResource($resource); // not pass
}
Expected behavior
public function testUnlinkResource(): void
{
$resource = fopen('php://temp', 'r');
fclose($resource);
static::assertFalse(is_resource($resource)); // pass
static::assertIsNotResource($resource); // pass
}
Summary
After unlink variable of type
resourceassertassertIsNotResourcedetect value as resource.Current behavior
IDE suggests to replace
static::assertFalsetostatic::assertIsNotResource. I don`t know it is bug or specific. But it is not obvious for me.How to reproduce
Expected behavior