From cac4692510d6b5da0d0a63f2ec54783df6ca86e4 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 18 Jan 2010 12:35:26 -0800 Subject: Don't use rand() as the name. Now that ORM::load_types() is gone, it won't get coerced to a string, and then we wind up comparing: 12345 != 12345-12321 In the old approach, they'd both be strings so they'd be inequal. But in the new approach the first value is an integer (sinced it came from rand()) so the second value is typecast to an integer which drops everything after the - sign so they appear equal. --- modules/gallery/tests/Album_Helper_Test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/gallery/tests/Album_Helper_Test.php b/modules/gallery/tests/Album_Helper_Test.php index 1284b8cc..ef0905da 100644 --- a/modules/gallery/tests/Album_Helper_Test.php +++ b/modules/gallery/tests/Album_Helper_Test.php @@ -38,7 +38,7 @@ class Album_Helper_Test extends Unit_Test_Case { } public function create_conflicting_album_test() { - $rand = rand(); + $rand = "name_" . rand(); $root = ORM::factory("item", 1); $album1 = album::create($root, $rand, $rand, $rand); $album2 = album::create($root, $rand, $rand, $rand); -- cgit v1.2.3