phpstan/phpstan-phpunit

ensure use of assertInstanceOf

arderyp opened this issue · 2 comments

Example

$this->assertSame(MyClass::class, get_class($object));

should be changed to

$this->assertInstanceOf(MyClass::class, $object);

This is similar to the existing rule about using

$this->assertCount(5, $array);

instead of

$this->assertSame(5, count($array));

They are not equivalent.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.