Author: Tobias Schlitt Date: 2007-03-08 15:15:15 +0100 (Thu, 08 Mar 2007) New Revision: 4734
Log: - Fixed issue #10369: testAddRelatedBirthdayToPerson3UpdateSuccess fails for no apparant reason. # The test case tested actually the failure, which is correct in that case. I # adjusted the test case to work correctly and renamed it accordingly. Modified: trunk/PersistentObject/tests/one_to_one_relation_test.php Modified: trunk/PersistentObject/tests/one_to_one_relation_test.php =================================================================== --- trunk/PersistentObject/tests/one_to_one_relation_test.php 2007-03-08 14:06:57 UTC (rev 4733) +++ trunk/PersistentObject/tests/one_to_one_relation_test.php 2007-03-08 14:15:15 UTC (rev 4734) @@ -291,7 +291,7 @@ ); } - public function testAddRelatedBirthdayToPerson3UpdateSuccess() + public function testAddRelatedBirthdayToPerson3UpdateFailure() { $person = $this->session->load( "RelationTestPerson", 3 ); @@ -301,15 +301,22 @@ ) ); $this->session->addRelatedObject( $person, $birthday ); - - $this->session->update( $birthday ); try { + $this->session->update( $birthday ); + } + catch ( ezcPersistentObjectNotPersistentException $e ) + { + // This exception is correct. The object is new and should not be updated. + } + + try + { // The birthday record should not exist $birthday = $this->session->load( "RelationTestBirthday", 3 ); } - catch ( Exception $e ) + catch ( ezcPersistentQueryException $e ) { return; } -- svn-components mailing list svn-components@lists.ez.no http://lists.ez.no/mailman/listinfo/svn-components