This repository was archived by the owner on Feb 20, 2023. It is now read-only.
This repository was archived by the owner on Feb 20, 2023. It is now read-only.
assert equals on cloned mocks #100
Closed
Description
The following works on phpunit 3.6 but it doesn't work on 3.7.
$a = $this->getMockBuilder('stdClass')->getMock();
$b = clone $a;
$this->assertEquals($a, $b);
Fails because of the __phpunit_id
which was added.
When you mock a dependency and the code you are testing clones it, doing assertEquals()
before was working. Maybe assertEquals()
should ignore this attribute, since if we wanted to know if it is exactly the same object we'd use assertSame()
.
Metadata
Metadata
Assignees
Labels
No labels