You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class Test extends \PHPUnit\Framework\TestCase
{
publicfunctiontestAssertVariable()
{
$foo = null;
$value = new \stdClass();
$mock = $this->getMockBuilder('Foo')->setMethods(['update'])->getMock();
$mock->method('update')->willReturnCallback(function () use (&$foo, $value) {
$foo = $value;
});
$this->assertSame($value, $foo);
}
}
$foo variable equals $value after $mock->update() call but PHPStan throws error Call to assertSame() with different types stdClass and null will always result in test failure.
The text was updated successfully, but these errors were encountered:
Example
$foo
variable equals$value
after$mock->update()
call but PHPStan throws errorCall to assertSame() with different types stdClass and null will always result in test failure.
The text was updated successfully, but these errors were encountered: