forked from the-crucible/phpunit-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path23Equals4.php
More file actions
32 lines (30 loc) · 764 Bytes
/
23Equals4.php
File metadata and controls
32 lines (30 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
/**
* assertEquals(
* object $expected,
* object $actual[,
* string $message = '']
* )
*
* Reports an error identified by $message if the two objects $expected and
* $actual do not have equal attribute values.
*
*/
class ObjectEqualsTest extends PHPUnit_Framework_TestCase
{
/**
* This function checks that two objects are identical or not
* means 1. Instance of thee same object 2. Same value of the attributes
*/
public function testFailure()
{
$expected = new stdClass;
$expected->foo = 'foo';
$expected->bar = 'bar';
$actual = new stdClass;
$actual->foo = 'bar';
$actual->baz = 'bar';
$this->assertEquals($expected, $actual);
}
}
?>