Another question regarding Doctrine and unit testing:

I want to completely reset Doctrine between two assertions - so to say
clear all caches (Identity map, etc?) to make sure that the test acts
the same way as with two different http requests.

Example from a unit test:

$user = Doctrine::getTable('user')->findOneByUsername('thomas');

$t->is($user->Phonenumber->number, '1234', 'returns the correct phone
number');

$user->Phonenumber->number = '9876;
$user->save();

// now how to completely reset Doctrine?

$t->is(Doctrine::getTable('user')->findOneByUsername('thomas')-
>Phonenumber->number, '9876', 'Phonenumber was updated correctly');

Of course this is a simplified example, but the usecase is again
hunting down a bug in a much more complex environment. I'm drilling
down into this issue, because the unit test works, wheras I have
problems when using the web frontend. So I suppose there is some
caching going on even when unsetting $user between the two assertions.

Thanks, Klemens


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to