Changeset 2144
- Timestamp:
- 04/29/08 21:48:06 (7 months ago)
- Files:
-
- branches/release-36/t/driver-tests.pl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/release-36/t/driver-tests.pl
r2143 r2144 104 104 } 105 105 106 is_first_foo(scalar Foo->load( $foo[0]->id), 'Foo #1 by id');107 is_first_foo(scalar Foo->load({ id => $foo[0]->id}), 'Foo #1 by id hash');108 is_first_foo(scalar Foo->load({ id => $foo[0]->id, name => $foo[0]->name}), 'Foo #1 by id-name hash');109 is_first_foo(scalar Foo->load({ name => $foo[0]->name}), 'Foo #1 by name hash');106 is_first_foo(scalar Foo->load(1), 'Foo #1 by id'); 107 is_first_foo(scalar Foo->load({ id => 1 }), 'Foo #1 by id hash'); 108 is_first_foo(scalar Foo->load({ id => 1, name => 'foo' }), 'Foo #1 by id-name hash'); 109 is_first_foo(scalar Foo->load({ name => 'foo' }), 'Foo #1 by name hash'); 110 110 is_first_foo(scalar Foo->load({ created_on => $foo[0]->created_on }), 'Foo #1 by created_on hash'); 111 is_first_foo(scalar Foo->load({ status => $foo[0]->status}), 'Foo #1 by status hash');111 is_first_foo(scalar Foo->load({ status => 2 }), 'Foo #1 by status hash'); 112 112 113 113 ## Change column value, save, try to load using old value (fail?), 114 114 ## then load again using new value 115 115 $foo[0]->status(0); 116 ok($foo[0]->save, ' saved');116 ok($foo[0]->save, 'Foo #1 saved with new status (0)'); 117 117 $tmp = Foo->load({ status => 2 }); 118 ok(!$tmp, ' no Foo');118 ok(!$tmp, 'Foo #1 no longer loads with old status (2)'); 119 119 $tmp = Foo->load({ status => 0 }); 120 isa_ok($tmp, 'Foo' );121 is($tmp->id, $foo[0]->id, 'id');122 is($tmp->status, 0, ' status');120 isa_ok($tmp, 'Foo', 'Foo #1 by new status (0)'); 121 is($tmp->id, 1, 'Foo #1 still has id of 1'); 122 is($tmp->status, 0, 'Foo #1 has its new status (0)'); 123 123 124 124 ## Create a new object so we can do range and last/first lookups.
