📜  assertequals vs assertsame - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:07.745000             🧑  作者: Mango

代码示例1
// assertSame reports an error if the two variables $expected and $actual
// do not have the SAME TYPE AND VALUE.
'2204' !== 2204
assertSame('2204', 2204) // this test fails

// assertEquals reports an error if the two variables $expected and $actual
// are NOT EQUAL. IT DOES NOT APPEAR TO TAKE DATATYPE INTO CONSIDERATION.
'2204' == 2204
assertEquals('2204', 2204) // this test passes