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.
This commit is contained in:
Bharat Mediratta
2010-01-18 12:35:26 -08:00
parent b27907fff7
commit cac4692510
+1 -1
View File
@@ -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);