From 903ae8a581fac1e6917fc3e31d2ad8fb91df80c3 Mon Sep 17 00:00:00 2001 From: ctrlaltca <> Date: Thu, 12 Jul 2012 11:21:01 +0000 Subject: standardize the use of unix eol; use svn properties to enforce native eol --- .../ActiveRecord/ActiveRecordRegistryTestCase.php | 330 ++++++++++----------- 1 file changed, 165 insertions(+), 165 deletions(-) (limited to 'tests/simple_unit/ActiveRecord/ActiveRecordRegistryTestCase.php') diff --git a/tests/simple_unit/ActiveRecord/ActiveRecordRegistryTestCase.php b/tests/simple_unit/ActiveRecord/ActiveRecordRegistryTestCase.php index fbae5a4b..fe1507cd 100644 --- a/tests/simple_unit/ActiveRecord/ActiveRecordRegistryTestCase.php +++ b/tests/simple_unit/ActiveRecord/ActiveRecordRegistryTestCase.php @@ -1,167 +1,167 @@ -assertTrue($registry->isNewObject($obj)); - $this->assertFalse($registry->isDirtyObject($obj)); - $this->assertFalse($registry->isRemovedObject($obj)); - $this->assertFalse($registry->isCleanObject($obj)); - } - - function test_clean_object_registers_without_error() - { - $obj = new StateTestObject(); - $registry = new TActiveRecordStateRegistry(); - $registry->registerClean($obj); - - $this->assertFalse($registry->isNewObject($obj)); - $this->assertFalse($registry->isDirtyObject($obj)); - $this->assertFalse($registry->isRemovedObject($obj)); - $this->assertTrue($registry->isCleanObject($obj)); - } - - function test_clean_object_becomes_dirty_when_changed() - { - $obj = new StateTestObject(); - $registry = new TActiveRecordStateRegistry(); - - $registry->registerClean($obj); - - $obj->propB='b'; - - $this->assertFalse($registry->isNewObject($obj)); - $this->assertTrue($registry->isDirtyObject($obj)); - $this->assertFalse($registry->isRemovedObject($obj)); - $this->assertFalse($registry->isCleanObject($obj)); - } - - function test_removed_object_must_register_as_clean_first() - { - $obj = new StateTestObject(); - $registry = new TActiveRecordStateRegistry(); - - try - { - $registry->registerRemoved($obj); - $this->fail(); - } - catch(TActiveRecordException $e) - { - $this->pass(); - } - } - - function test_removed_object_registers_without_error() - { - $obj = new StateTestObject(); - $registry = new TActiveRecordStateRegistry(); - $registry->registerClean($obj); - - $registry->registerRemoved($obj); - - $this->assertFalse($registry->isNewObject($obj)); - $this->assertFalse($registry->isDirtyObject($obj)); - $this->assertTrue($registry->isRemovedObject($obj)); - $this->assertFalse($registry->isCleanObject($obj)); - } - - - function test_removed_object_can_not_become_clean() - { - $obj = new StateTestObject(); - $registry = new TActiveRecordStateRegistry(); - $registry->registerClean($obj); - - $registry->registerRemoved($obj); - - try - { - $registry->registerClean($obj); - $this->fail(); - } - catch(TActiveRecordException $e) - { - $this->pass(); - } - - $this->assertFalse($registry->isNewObject($obj)); - $this->assertFalse($registry->isDirtyObject($obj)); - $this->assertTrue($registry->isRemovedObject($obj)); - $this->assertFalse($registry->isCleanObject($obj)); - } - - function test_remove_dirty_object() - { - $obj = new StateTestObject(); - $registry = new TActiveRecordStateRegistry(); - - $registry->registerClean($obj); - - $obj->propB='b'; - - $this->assertFalse($registry->isNewObject($obj)); - $this->assertTrue($registry->isDirtyObject($obj)); - $this->assertFalse($registry->isRemovedObject($obj)); - $this->assertFalse($registry->isCleanObject($obj)); - - $registry->registerRemoved($obj); - - $this->assertFalse($registry->isNewObject($obj)); - $this->assertFalse($registry->isDirtyObject($obj)); - $this->assertTrue($registry->isRemovedObject($obj)); - $this->assertFalse($registry->isCleanObject($obj)); - - try - { - $registry->registerClean($obj); - $this->fail(); - } - catch(TActiveRecordException $e) - { - $this->pass(); - } - } - - function test_clean_dirty_clean_object() - { - $obj = new StateTestObject(); - $registry = new TActiveRecordStateRegistry(); - - $registry->registerClean($obj); - - $this->assertFalse($registry->isNewObject($obj)); - $this->assertFalse($registry->isDirtyObject($obj)); - $this->assertFalse($registry->isRemovedObject($obj)); - $this->assertTrue($registry->isCleanObject($obj)); - - $obj->propB='b'; - - $this->assertFalse($registry->isNewObject($obj)); - $this->assertTrue($registry->isDirtyObject($obj)); - $this->assertFalse($registry->isRemovedObject($obj)); - $this->assertFalse($registry->isCleanObject($obj)); - - $registry->registerClean($obj); - - $this->assertFalse($registry->isNewObject($obj)); - $this->assertFalse($registry->isDirtyObject($obj)); - $this->assertFalse($registry->isRemovedObject($obj)); - $this->assertTrue($registry->isCleanObject($obj)); - } - -} +assertTrue($registry->isNewObject($obj)); + $this->assertFalse($registry->isDirtyObject($obj)); + $this->assertFalse($registry->isRemovedObject($obj)); + $this->assertFalse($registry->isCleanObject($obj)); + } + + function test_clean_object_registers_without_error() + { + $obj = new StateTestObject(); + $registry = new TActiveRecordStateRegistry(); + $registry->registerClean($obj); + + $this->assertFalse($registry->isNewObject($obj)); + $this->assertFalse($registry->isDirtyObject($obj)); + $this->assertFalse($registry->isRemovedObject($obj)); + $this->assertTrue($registry->isCleanObject($obj)); + } + + function test_clean_object_becomes_dirty_when_changed() + { + $obj = new StateTestObject(); + $registry = new TActiveRecordStateRegistry(); + + $registry->registerClean($obj); + + $obj->propB='b'; + + $this->assertFalse($registry->isNewObject($obj)); + $this->assertTrue($registry->isDirtyObject($obj)); + $this->assertFalse($registry->isRemovedObject($obj)); + $this->assertFalse($registry->isCleanObject($obj)); + } + + function test_removed_object_must_register_as_clean_first() + { + $obj = new StateTestObject(); + $registry = new TActiveRecordStateRegistry(); + + try + { + $registry->registerRemoved($obj); + $this->fail(); + } + catch(TActiveRecordException $e) + { + $this->pass(); + } + } + + function test_removed_object_registers_without_error() + { + $obj = new StateTestObject(); + $registry = new TActiveRecordStateRegistry(); + $registry->registerClean($obj); + + $registry->registerRemoved($obj); + + $this->assertFalse($registry->isNewObject($obj)); + $this->assertFalse($registry->isDirtyObject($obj)); + $this->assertTrue($registry->isRemovedObject($obj)); + $this->assertFalse($registry->isCleanObject($obj)); + } + + + function test_removed_object_can_not_become_clean() + { + $obj = new StateTestObject(); + $registry = new TActiveRecordStateRegistry(); + $registry->registerClean($obj); + + $registry->registerRemoved($obj); + + try + { + $registry->registerClean($obj); + $this->fail(); + } + catch(TActiveRecordException $e) + { + $this->pass(); + } + + $this->assertFalse($registry->isNewObject($obj)); + $this->assertFalse($registry->isDirtyObject($obj)); + $this->assertTrue($registry->isRemovedObject($obj)); + $this->assertFalse($registry->isCleanObject($obj)); + } + + function test_remove_dirty_object() + { + $obj = new StateTestObject(); + $registry = new TActiveRecordStateRegistry(); + + $registry->registerClean($obj); + + $obj->propB='b'; + + $this->assertFalse($registry->isNewObject($obj)); + $this->assertTrue($registry->isDirtyObject($obj)); + $this->assertFalse($registry->isRemovedObject($obj)); + $this->assertFalse($registry->isCleanObject($obj)); + + $registry->registerRemoved($obj); + + $this->assertFalse($registry->isNewObject($obj)); + $this->assertFalse($registry->isDirtyObject($obj)); + $this->assertTrue($registry->isRemovedObject($obj)); + $this->assertFalse($registry->isCleanObject($obj)); + + try + { + $registry->registerClean($obj); + $this->fail(); + } + catch(TActiveRecordException $e) + { + $this->pass(); + } + } + + function test_clean_dirty_clean_object() + { + $obj = new StateTestObject(); + $registry = new TActiveRecordStateRegistry(); + + $registry->registerClean($obj); + + $this->assertFalse($registry->isNewObject($obj)); + $this->assertFalse($registry->isDirtyObject($obj)); + $this->assertFalse($registry->isRemovedObject($obj)); + $this->assertTrue($registry->isCleanObject($obj)); + + $obj->propB='b'; + + $this->assertFalse($registry->isNewObject($obj)); + $this->assertTrue($registry->isDirtyObject($obj)); + $this->assertFalse($registry->isRemovedObject($obj)); + $this->assertFalse($registry->isCleanObject($obj)); + + $registry->registerClean($obj); + + $this->assertFalse($registry->isNewObject($obj)); + $this->assertFalse($registry->isDirtyObject($obj)); + $this->assertFalse($registry->isRemovedObject($obj)); + $this->assertTrue($registry->isCleanObject($obj)); + } + +} ?> \ No newline at end of file -- cgit v1.2.3