X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Frun%2F01core.tl;h=a2c35b71737ed84967c363ad9e943944659f0244;hb=90f3f5ff9b01602cc4bca97fac113d65fb8efb7c;hp=3f5eace43b7e6892f8870864ec023221ad5cf7a0;hpb=0567538f9dcf59ff0dcf0fe766815b242115ce20;p=dbsrgits%2FDBIx-Class.git diff --git a/t/run/01core.tl b/t/run/01core.tl index 3f5eace..a2c35b7 100644 --- a/t/run/01core.tl +++ b/t/run/01core.tl @@ -1,6 +1,6 @@ sub run_tests { -plan tests => 22; +plan tests => 28; my @art = DBICTest::Artist->search({ }, { order_by => 'name DESC'}); @@ -70,8 +70,29 @@ $new_again = DBICTest::Artist->find(4); is($new_again->name, 'Man With A Spoon', 'Retrieved correctly'); +is($new_again->ID, 'DBICTest::Artist|artistid=4', 'unique object id generated correctly'); + is(DBICTest::Artist->count, 4, 'count ok'); +my $cd = DBICTest::CD->find(1); +my %cols = $cd->get_columns; + +cmp_ok(keys %cols, '==', 4, 'get_columns number of columns ok'); + +is($cols{title}, 'Spoonful of bees', 'get_columns values ok'); + +%cols = ( title => 'Forkful of bees', year => 2005); +$cd->set_columns(\%cols); + +is($cd->title, 'Forkful of bees', 'set_columns ok'); + +is($cd->year, 2005, 'set_columns ok'); + +$cd->discard_changes; + +$cd = DBICTest::CD->search({ title => 'Spoonful of bees' }, { cols => ['title'] })->next; +is($cd->title, 'Spoonful of bees', 'subset of columns returned correctly'); + # insert_or_update $new = DBICTest::Track->new( { trackid => 100,