There is something weird going on in my code so i have to ask.
I have a part of a test:
public function testGetAddresses()
{
//$this->markTestIncomplete('Not implemented yet');
$this->assertTrue($this->_prs->getAddresses() instanceof Crm_Collection);
}
This test fails.
But when I do this:
if ($entity->getAddresses() instanceof Crm_Collection) {
echo "TRUE!";
} else {
echo "FALSE!";
}
It outputs TRUE!
Anybody knows what is going on or might this be a bug in phpunit?
Thanks!
Why vadimbelyaev said:
I don’t think it’s an issue with phpunit, doublecheck your code.
Additionally you can use:
so you get a nice error in case it fails.
(Phpunit will tell you “expected class, got null” instead of “expected true, got false” with helps a lot while debugging 🙂 )