[FLOW3-general] Phpunit: Mocking persistence/ aspects

Martin Eisengardt MEP_Eisen at web.de
Mon Oct 25 18:07:34 CEST 2010


Another question :-)
 
First let me explain what I am doing. I played around creating some kind of transactional support. Some kind of transactional entities should be able to persist their changes in database and later on commit or resume them to the trunk object state. That may be useful to have transaction management spread over multiple requests.
 
For now I am looking for a way to write the unit tests. The test case will have to verify that changes are persisted in database. After creating an entity the persistence will be forced to persist all (thats all about the first request would be doing). Then the entity is queried from persistence (At this point the second request would be starting) and I will do some assertions. Because the transactional stuff is implemented by aspects I would need a full working ObjectManager that does the aop stuff on the entity. I will need a full working backend (or some mocked backend). I will need a possibility to invoke persistAll.

Is there some code or some helper class I can use? Or is there a full working RAM-only backend I can use?


Greeting
 Martin


More information about the FLOW3-general mailing list