[TYPO3-mvc] RFC #11230: Allow multiple repositories per model class and add unit tests for the persistence manager

Oliver Klee typo3-german-02 at oliverklee.de
Sat Dec 18 17:18:53 CET 2010


Hi,

Am 18.12.2010 02:00, schrieb Pascal Jungblut:
> I'd like to test it, but it seems that my objects are not stored in the session. Can you give me a hint how I can force that? Just calling findByUid() doesn't seem to do the trick.

1. Create a repository that does not follow the naming convention for
that Model, e.g. a BetterBar repository for a Bar model by setting the
object type in the repository constructor:

public function __construct() {
	parent::__construct();
	$this->objectType = 'Tx_Foo_Domain_Model_Bar';
}

2. Create a model in the DB (e.g. in the Web > List module).

3. findByUid() the model, change a property, and update() it.

4. check that the updated model has been persisted to the DB (e.g. by
opening it in Web > List and looking for the changed property)


Expected result:
The property has the new value.

Actual result (without the patch):
The property still has the old value.


You can also test this by running the unit tests for the persistence
manager.


Oli
-- 
Certified TYPO3 Integrator | TYPO3 Security Team Member


More information about the TYPO3-project-typo3v4mvc mailing list