Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__phpunit_id breaks equal assert (phpunit 3.7) #666

Closed
voda opened this issue Sep 24, 2012 · 2 comments
Closed

__phpunit_id breaks equal assert (phpunit 3.7) #666

voda opened this issue Sep 24, 2012 · 2 comments

Comments

@voda
Copy link

voda commented Sep 24, 2012

After upgrading to PHPUnit 3.7.1 some of my test fail because of the __phpunit_id attribute.
Test code:

$a = $this->getMock('\stdClass');
$b = $this->getMock('\stdClass');
$this->assertEquals($a, $b);

In PHPUnit 3.6 this code works, in 3.7.1 the output is:

Failed asserting that two objects are equal.
--- Expected
+++ Actual
@@ @@
 Mock_stdClass_f9d48dc3 Object (
     '__phpunit_invocationMocker' => null
-    '__phpunit_id' => 'Mock_stdClass_f9d48dc3#0'
+    '__phpunit_id' => 'Mock_stdClass_f9d48dc3#1'
 )
@voda
Copy link
Author

voda commented Sep 24, 2012

I just realized that my tests are wrong written and after fixing them all works well.

@voda voda closed this as completed Sep 24, 2012
@edorian
Copy link
Contributor

edorian commented Sep 24, 2012

Related: sebastianbergmann/phpunit-mock-objects#100

Like you stated the behavior (not matching anymore) is intended as they are two different objects :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants