Skip to content
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
@fd8s0

Description

@fd8s0

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions