assertSame () == Checks if the actual output and the expected parameter are the same.
i.e:
$this->assertSame('$expected','$expected');
or
$this->assertSame('100','100');
assertEquals == If we see in relation to the website page, I have a page with 2 "tables", so when I run assertEquals, I will check its quantity, that the "table" is 2 using the count function. For example:
$this->assertEquals(2, $var->filter('table')->count());
Here we see that assertEquals checks for two tables on a web page. we can also use the partitions found on the page using the "section name" inside the brackets.
For example, 2:
public function testAdd() { $calc = new Calculator(); $result = $calc->add(30, 12);
Arpan Buch Aug 14 '13 at 12:03 2013-08-14 12:03
source share