This is a PHPUnit test:
class EqualsTest extends PHPUnit_Framework_TestCase
{
public function testSuccess()
{
$this->assertEquals(array('01', 'a', 'b'), array(1, 'a', 'b'));
}
}
'01' is a string and 1 is an integer but the test is not failling! assertEquals does not comparing types... how to overcome this problem?
assertSame will work in this case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With