summaryrefslogtreecommitdiff
path: root/modules/gallery/tests
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-07-16 11:19:34 -0700
committerBharat Mediratta <bharat@menalto.com>2009-07-16 11:19:34 -0700
commit5b3b675b6d8a1cd9a5f2b9455c551791e18d88ff (patch)
tree239f6042596a5168b9023706c33a0f89ebaf6d1d /modules/gallery/tests
parent2864aceb8117d0644b264ceca4d0f84fd028538f (diff)
Non-trivial changes to the event handling code:
1) The item_updated event no longer takes the old and new items. Instead we overload ORM to track the original data and make that available via the item. This will allow us to move event publishing down into the API methods which in turn will give us more stability since we won't require each controller to remember to do it. 2) ORM class now tracks the original values. It doesn't track the original relationships (no need for that, yet) 3) Added new events: item_deleted group_deleted user_deleted
Diffstat (limited to 'modules/gallery/tests')
-rw-r--r--modules/gallery/tests/Item_Model_Test.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/gallery/tests/Item_Model_Test.php b/modules/gallery/tests/Item_Model_Test.php
index 615b8997..a21cdc13 100644
--- a/modules/gallery/tests/Item_Model_Test.php
+++ b/modules/gallery/tests/Item_Model_Test.php
@@ -140,4 +140,20 @@ class Item_Model_Test extends Unit_Test_Case {
}
$this->assert_false(true, "Item_Model::rename should not accept / characters");
}
+
+ public function save_original_values_test() {
+ print "START\n";
+ $item = $this->create_random_item();
+ $item->title = "ORIGINAL_VALUE";
+ $item->save();
+
+ print "CHANGE\n";
+ $item->title = "NEW_VALUE";
+
+ //printf("<pre>%s</pre>",print_r($item,1));flush();
+
+ print "COMPARE\n";
+ $this->assert_same("ORIGINAL_VALUE", $item->original("title"));
+ $this->assert_same("NEW_VALUE", $item->title);
+ }
}