For when I check for example in the unit tests that a user did not create assertEquals(0,User::count)
or assertSame(0,User::count)
For when I check for example in the unit tests that a user did not create assertEquals(0,User::count)
or assertSame(0,User::count)
The fundamental difference is that'assertEquals' responds to result checks, not type. AssertSame checks in addition to the value, of the associated type. If you check a string that contains a number, against an integer, assertEquals can return true. AssertSame would check the type, and return false.
assertEquals: devolveria true si compruebas algo tipo '5' == 5.
assertSame: devolveria false, porque los tipos no coinciden
reference in stackoverflow: link