Author: ts Date: Thu Jan 17 17:29:39 2008 New Revision: 7169 Log: - Added general serialization/deserialization test case for definitions.
Modified: trunk/PersistentObject/tests/persistent_session_misc_test.php Modified: trunk/PersistentObject/tests/persistent_session_misc_test.php ============================================================================== --- trunk/PersistentObject/tests/persistent_session_misc_test.php [iso-8859-1] (original) +++ trunk/PersistentObject/tests/persistent_session_misc_test.php [iso-8859-1] Thu Jan 17 17:29:39 2008 @@ -189,6 +189,33 @@ } catch( ezcPersistentInvalidObjectStateException $e ) {} } + + public function testObjectDefinitionSerialization() + { + $persistentClasses = array( + 'PersistentTestObject', + 'PersistentTestObjectConverter', + 'RelationTestAddress', + 'RelationTestBirthday', + 'RelationTestEmployer', + 'RelationTestPerson', + 'RelationTestSecondPerson', + ); + + foreach( $persistentClasses as $persistentClass ) + { + $original = $this->session->definitionManager->fetchDefinition( 'RelationTestPerson' ); + $export = 'return ' . var_export( $original, true ) . ';'; + $import = eval( $export ); + + $this->assertEquals( + $original, + $import, + "Persistent object definition not correctly deserialized for class $persistentClass." + ); + + } + } } ?> -- svn-components mailing list svn-components@lists.ez.no http://lists.ez.no/mailman/listinfo/svn-components