Open teohhanhui opened 4 years ago
I ran into the same issue with assertSame()
use PHPUnit\Framework\TestCase;
final class Test extends TestCase
{
public function test(): void
{
touch('/file');
$handle = fopen('/file', 'rwb');
self::assertSame(0, fwrite($handle, 'data'));
self::assertSame('data', fread($handle, 2));
}
}
Call to static method PHPUnit\Framework\Assert::assertSame() with 0 and int<0, max>|false will always evaluate to true.
Call to static method PHPUnit\Framework\Assert::assertSame() with 'data' and string|false will always evaluate to true.
Given this class:
And calling
assertSame
like this:Gives an error such as: