summaryrefslogtreecommitdiff
path: root/core/tests/ORM_MPTT_Test.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-03-11 00:41:51 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-03-11 00:41:51 +0000
commitee2407cde2b45aa667d30ca24f483c729340f462 (patch)
treea69166a00e02bd1cd22b8d85e25e1c6117b4445e /core/tests/ORM_MPTT_Test.php
parent2ce44b6b08f4623da872574867f7b7498ef5a1c4 (diff)
Fix the test failures. If albums are created manually instead of
calling album::create, then the default sourt column needs to be set to id.
Diffstat (limited to 'core/tests/ORM_MPTT_Test.php')
-rw-r--r--core/tests/ORM_MPTT_Test.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/tests/ORM_MPTT_Test.php b/core/tests/ORM_MPTT_Test.php
index f16d7e59..7109d43b 100644
--- a/core/tests/ORM_MPTT_Test.php
+++ b/core/tests/ORM_MPTT_Test.php
@@ -22,6 +22,9 @@ class ORM_MPTT_Test extends Unit_Test_Case {
private function create_item_and_add_to_parent($parent) {
$album = ORM::factory("item");
$album->type = "album";
+ $album->rand_key = ((float)mt_rand()) / (float)mt_getrandmax();
+ $album->sort_column = "id";
+ $album->sort_order = "ASC";
$album->add_to_parent($parent);
return $album;
}
@@ -30,6 +33,9 @@ class ORM_MPTT_Test extends Unit_Test_Case {
$root = ORM::factory("item", 1);
$album = ORM::factory("item");
$album->type = "album";
+ $album->rand_key = ((float)mt_rand()) / (float)mt_getrandmax();
+ $album->sort_column = "id";
+ $album->sort_order = "ASC";
$album->add_to_parent($root);
$this->assert_equal($album->parent()->right - 2, $album->left);
@@ -152,6 +158,9 @@ class ORM_MPTT_Test extends Unit_Test_Case {
$parent = ORM::factory("item");
$parent->type = "album";
+ $parent->rand_key = ((float)mt_rand()) / (float)mt_getrandmax();
+ $parent->sort_column = "id";
+ $parent->sort_order = "ASC";
$parent->add_to_parent($root);
$photo = ORM::factory("item");
@@ -160,6 +169,9 @@ class ORM_MPTT_Test extends Unit_Test_Case {
$album1 = ORM::factory("item");
$album1->type = "album";
+ $album1->rand_key = ((float)mt_rand()) / (float)mt_getrandmax();
+ $album1->sort_column = "id";
+ $album1->sort_order = "ASC";
$album1->add_to_parent($parent);
$photo1 = ORM::factory("item");