Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

assertequals vs assertsame

// 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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #assertequals #assertsame
ADD COMMENT
Topic
Name
7+3 =