Testing a Doctrine2 Entity with assertEquals results in fatal out-of-memory error

Posted by Matt on Stack Overflow See other posts from Stack Overflow or by Matt
Published on 2012-03-22T03:28:55Z Indexed on 2012/03/22 23:29 UTC
Read the original article Hit count: 432

Filed under:
|
|

I have a PHPUnit test that's using a Doctrine2 custom repository and Doctrine Fixtures. I wanted to test that a query gave me back an expected entity from my fixture.

But when I try $this->assertEquals($expectedEntity, $result);, I get Fatal error: out of memory. I'm guessing it is recursing into all the relations and the entity manager and whatnot.

Is there a good way to test this equality? Should I just assertEquals on the IDs of the entities?

© Stack Overflow or respective owner

Related posts about php

Related posts about doctrine2