From: Matt S Trout Date: Sat, 14 Jan 2006 08:05:51 +0000 (+0000) Subject: More test hackage, some cleanup in ResultSet X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f9db552739e7c980acb4280cb2b6c739a769da5a;p=dbsrgits%2FDBIx-Class-Historic.git More test hackage, some cleanup in ResultSet --- diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index a33e22f..84169a3 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -35,7 +35,7 @@ not perform any queries -- these are executed as needed by the other methods. sub new { my $class = shift; - $class->new_result(@_) if ref $class; + return $class->new_result(@_) if ref $class; my ($source, $attrs) = @_; #use Data::Dumper; warn Dumper(@_); $attrs = Storable::dclone($attrs || {}); # { %{ $attrs || {} } }; @@ -67,7 +67,7 @@ sub new { unless $seen{$pre}; my @pre = map { "$pre.$_" } - $source->result_class->relationship_info($pre)->{class}->columns; + $source->related_source($pre)->columns; push(@{$attrs->{select}}, @pre); push(@{$attrs->{as}}, @pre); } @@ -177,7 +177,7 @@ sub find { sub search_related { my ($self, $rel, @rest) = @_; - my $rel_obj = $self->{source}->result_class->relationship_info($rel); + my $rel_obj = $self->{source}->relationship_info($rel); $self->{source}->result_class->throw( "No such relationship ${rel} in search_related") unless $rel_obj; diff --git a/t/run/01core.tl b/t/run/01core.tl index 5b2ef11..43f328b 100644 --- a/t/run/01core.tl +++ b/t/run/01core.tl @@ -3,7 +3,7 @@ my $schema = shift; plan tests => 34; -my @art = $schema->class("Artist")->search({ }, { order_by => 'name DESC'}); +my @art = $schema->resultset("Artist")->search({ }, { order_by => 'name DESC'}); cmp_ok(@art, '==', 3, "Three artists returned"); @@ -19,7 +19,7 @@ is($art->get_column("name"), 'We Are In Rehab', 'And via get_column'); ok($art->update, 'Update run'); -@art = $schema->class("Artist")->search({ name => 'We Are In Rehab' }); +@art = $schema->resultset("Artist")->search({ name => 'We Are In Rehab' }); cmp_ok(@art, '==', 1, "Changed artist returned by search"); @@ -27,7 +27,7 @@ cmp_ok($art[0]->artistid, '==', 3,'Correct artist too'); $art->delete; -@art = $schema->class("Artist")->search({ }); +@art = $schema->resultset("Artist")->search({ }); cmp_ok(@art, '==', 2, 'And then there were two'); @@ -43,15 +43,15 @@ $art->insert; ok($art->in_storage, "Re-created"); -@art = $schema->class("Artist")->search({ }); +@art = $schema->resultset("Artist")->search({ }); cmp_ok(@art, '==', 3, 'And now there are three again'); -my $new = $schema->class("Artist")->create({ artistid => 4 }); +my $new = $schema->resultset("Artist")->create({ artistid => 4 }); cmp_ok($new->artistid, '==', 4, 'Create produced record ok'); -@art = $schema->class("Artist")->search({ }); +@art = $schema->resultset("Artist")->search({ }); cmp_ok(@art, '==', 4, "Oh my god! There's four of them!"); @@ -67,15 +67,15 @@ $new->name('Man With A Spoon'); $new->update; -$new_again = $schema->class("Artist")->find(4); +$new_again = $schema->resultset("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($schema->class("Artist")->count, 4, 'count ok'); +is($schema->resultset("Artist")->count, 4, 'count ok'); -my $cd = $schema->class("CD")->find(1); +my $cd = $schema->resultset("CD")->find(1); my %cols = $cd->get_columns; cmp_ok(keys %cols, '==', 4, 'get_columns number of columns ok'); @@ -96,11 +96,11 @@ my @cd = $schema->source("CD")->ordered_columns; is_deeply( \@cd, [qw/cdid artist title year/], 'ordered_columns'); -$cd = $schema->class("CD")->search({ title => 'Spoonful of bees' }, { cols => ['title'] })->next; +$cd = $schema->resultset("CD")->search({ title => 'Spoonful of bees' }, { cols => ['title'] })->next; is($cd->title, 'Spoonful of bees', 'subset of columns returned correctly'); # insert_or_update -$new = $schema->class("Track")->new( { +$new = $schema->resultset("Track")->new( { trackid => 100, cd => 1, position => 1, @@ -112,9 +112,9 @@ ok($new->in_storage, 'insert_or_update insert ok'); # test in update mode $new->position(5); $new->insert_or_update; -is( $schema->class("Track")->find(100)->position, 5, 'insert_or_update update ok'); +is( $schema->resultset("Track")->find(100)->position, 5, 'insert_or_update update ok'); -eval { $schema->class("Track")->load_components('DoesNotExist'); }; +eval { $schema->resultset("Track")->load_components('DoesNotExist'); }; ok $@, $@; @@ -122,16 +122,16 @@ is($schema->class("Artist")->field_name_for->{name}, 'artist name', 'mk_classdat my $search = [ { 'tags.tag' => 'Cheesy' }, { 'tags.tag' => 'Blue' } ]; -my $or_rs = $schema->class("CD")->search($search, { join => 'tags', +my $or_rs = $schema->resultset("CD")->search($search, { join => 'tags', order_by => 'cdid' }); cmp_ok($or_rs->count, '==', 5, 'Search with OR ok'); -my $distinct_rs = $schema->class("CD")->search($search, { join => 'tags', distinct => 1 }); +my $distinct_rs = $schema->resultset("CD")->search($search, { join => 'tags', distinct => 1 }); cmp_ok($distinct_rs->all, '==', 4, 'DISTINCT search with OR ok'); -my $tag_rs = $schema->class('Tag')->search( +my $tag_rs = $schema->resultset('Tag')->search( [ { 'me.tag' => 'Cheesy' }, { 'me.tag' => 'Blue' } ]); my $rel_rs = $tag_rs->search_related('cd'); diff --git a/t/run/04db.tl b/t/run/04db.tl index e1da6b4..e3b5cbb 100644 --- a/t/run/04db.tl +++ b/t/run/04db.tl @@ -5,27 +5,27 @@ plan tests => 2; # add some rows inside a transaction and commit it # XXX: Is storage->dbh the only way to get a dbh? -$schema->class("Artist")->txn_begin; +$schema->storage->txn_begin; for (10..15) { - $schema->class("Artist")->create( { + $schema->resultset("Artist")->create( { artistid => $_, name => "artist number $_", } ); } -$schema->class("Artist")->txn_commit; -my ($artist) = $schema->class("Artist")->find(15); +$schema->storage->txn_commit; +my ($artist) = $schema->resultset("Artist")->find(15); is($artist->name, 'artist number 15', "Commit ok"); # add some rows inside a transaction and roll it back -$schema->class("Artist")->txn_begin; +$schema->storage->txn_begin; for (21..30) { - $schema->class("Artist")->create( { + $schema->resultset("Artist")->create( { artistid => $_, name => "artist number $_", } ); } -$schema->class("Artist")->txn_rollback; -($artist) = $schema->class("Artist")->search( artistid => 25 ); +$schema->storage->txn_rollback; +($artist) = $schema->resultset("Artist")->search( artistid => 25 ); is($artist, undef, "Rollback ok"); } diff --git a/t/run/05multipk.tl b/t/run/05multipk.tl index 25ded39..776a382 100644 --- a/t/run/05multipk.tl +++ b/t/run/05multipk.tl @@ -4,9 +4,9 @@ my $schema = shift; plan tests => 4; $artist = DBICTest::Artist->find(1); ok($artist->find_related('twokeys', {cd => 1}), "find multiple pks using relationships + args"); -ok($schema->class("FourKeys")->find(1,2,3,4), "find multiple pks without hash"); -ok($schema->class("FourKeys")->find(5,4,3,6), "find multiple pks without hash"); -is($schema->class("FourKeys")->find(1,2,3,4)->ID, 'DBICTest::FourKeys|bar=2|foo=1|goodbye=4|hello=3', 'unique object id ok for multiple pks'); +ok($schema->resultset("FourKeys")->find(1,2,3,4), "find multiple pks without hash"); +ok($schema->resultset("FourKeys")->find(5,4,3,6), "find multiple pks without hash"); +is($schema->resultset("FourKeys")->find(1,2,3,4)->ID, 'DBICTest::FourKeys|bar=2|foo=1|goodbye=4|hello=3', 'unique object id ok for multiple pks'); } diff --git a/t/run/06relationship.tl b/t/run/06relationship.tl index a954c1b..b0f8256 100644 --- a/t/run/06relationship.tl +++ b/t/run/06relationship.tl @@ -6,14 +6,14 @@ use warnings; plan tests => 17; # has_a test -my $cd = $schema->class("CD")->find(4); +my $cd = $schema->resultset("CD")->find(4); my ($artist) = ($INC{'DBICTest/HelperRels'} ? $cd->artist : $cd->search_related('artist')); is($artist->name, 'Random Boy Band', 'has_a search_related ok'); # has_many test with an order_by clause defined -$artist = $schema->class("Artist")->find(1); +$artist = $schema->resultset("Artist")->find(1); my @cds = ($INC{'DBICTest/HelperRels'} ? $artist->cds : $artist->search_related('cds')); @@ -42,7 +42,7 @@ is( ($artist->search_related('cds'))[3]->title, 'Big Flop', 'create_related ok' is( $artist->count_related('cds'), 4, 'count_related ok' ); # set_from_related -my $track = $schema->class("Track")->create( { +my $track = $schema->resultset("Track")->create( { trackid => 1, cd => 3, position => 98, @@ -57,7 +57,7 @@ if ($INC{'DBICTest/HelperRels.pm'}) { # except inflated object } # update_from_related, the same as set_from_related, but it calls update afterwards -$track = $schema->class("Track")->create( { +$track = $schema->resultset("Track")->create( { trackid => 2, cd => 3, position => 99, @@ -65,7 +65,7 @@ $track = $schema->class("Track")->create( { } ); $track->update_from_related( cd => $cd ); -my $t_cd = ($schema->class("Track")->search( cd => 4, position => 99 ))[0]->cd; +my $t_cd = ($schema->resultset("Track")->search( cd => 4, position => 99 ))[0]->cd; if ($INC{'DBICTest/HelperRels.pm'}) { # except inflated object is( $t_cd->cdid, 4, 'update_from_related ok' ); @@ -87,7 +87,7 @@ is( $cd->title, 'Greatest Hits', 'find_or_create_related new record ok' ); is( ($artist->search_related('cds'))[4]->title, 'Greatest Hits', 'find_or_create_related new record search ok' ); $artist->delete_related( cds => { title => 'Greatest Hits' }); -cmp_ok( $schema->class("CD")->search( title => 'Greatest Hits' ), '==', 0, 'delete_related ok' ); +cmp_ok( $schema->resultset("CD")->search( title => 'Greatest Hits' ), '==', 0, 'delete_related ok' ); SKIP: { skip "relationship checking needs fixing", 1; @@ -108,15 +108,15 @@ eval { like($@, qr/join condition/, 'failed when creating a rel without join condition, ok'); # many_to_many helper test -$cd = $schema->class("CD")->find(1); +$cd = $schema->resultset("CD")->find(1); my @producers = $cd->producers(); is( $producers[0]->name, 'Matt S Trout', 'many_to_many ok' ); # test undirected many-to-many relationship (e.g. "related artists") -my $undir_maps = $schema->class("Artist")->find(1)->artist_undirected_maps; +my $undir_maps = $schema->resultset("Artist")->find(1)->artist_undirected_maps; is($undir_maps->count, 1, 'found 1 undirected map for artist 1'); -$undir_maps = $schema->class("Artist")->find(2)->artist_undirected_maps; +$undir_maps = $schema->resultset("Artist")->find(2)->artist_undirected_maps; is($undir_maps->count, 1, 'found 1 undirected map for artist 2'); my @art = $undir_maps->search_related('mapped_artists')->all; diff --git a/t/run/07pager.tl b/t/run/07pager.tl index 9406d71..d864afa 100644 --- a/t/run/07pager.tl +++ b/t/run/07pager.tl @@ -4,7 +4,7 @@ my $schema = shift; plan tests => 12; # first page -my $it = $schema->class("CD")->search( +my $it = $schema->resultset("CD")->search( {}, { order_by => 'title', rows => 3, @@ -25,7 +25,7 @@ $it->next; is( $it->next, undef, "next past end of page ok" ); # second page, testing with array -my @page2 = $schema->class("CD")->search( +my @page2 = $schema->resultset("CD")->search( {}, { order_by => 'title', rows => 3, @@ -35,7 +35,7 @@ my @page2 = $schema->class("CD")->search( is( $page2[0]->title, "Generic Manufactured Singles", "second page first title ok" ); # page a standard resultset -$it = $schema->class("CD")->search( +$it = $schema->resultset("CD")->search( {}, { order_by => 'title', rows => 3 } @@ -47,7 +47,7 @@ is( $page->count, 2, "standard resultset paged rs count ok" ); is( $page->next->title, "Generic Manufactured Singles", "second page of standard resultset ok" ); # test software-based limit paging -$it = $schema->class("CD")->search( +$it = $schema->resultset("CD")->search( {}, { order_by => 'title', rows => 3, diff --git a/t/run/08inflate.tl b/t/run/08inflate.tl index 9072fd5..e21a6c6 100644 --- a/t/run/08inflate.tl +++ b/t/run/08inflate.tl @@ -13,7 +13,7 @@ DBICTest::Schema::CD->inflate_column( 'year', Class::C3->reinitialize; # inflation test -my $cd = $schema->class("CD")->find(3); +my $cd = $schema->resultset("CD")->find(3); is( ref($cd->year), 'DateTime', 'year is a DateTime, ok' ); @@ -24,7 +24,7 @@ my $now = DateTime->now; $cd->year( $now ); $cd->update; -($cd) = $schema->class("CD")->search( year => $now->year ); +($cd) = $schema->resultset("CD")->search( year => $now->year ); is( $cd->year->year, $now->year, 'deflate ok' ); } diff --git a/t/run/08inflate_has_a.tl b/t/run/08inflate_has_a.tl index 8763741..50f78c4 100644 --- a/t/run/08inflate_has_a.tl +++ b/t/run/08inflate_has_a.tl @@ -15,7 +15,7 @@ DBICTest::Schema::CD->has_a( 'year', 'DateTime', Class::C3->reinitialize; # inflation test -my $cd = $schema->class("CD")->find(3); +my $cd = $schema->resultset("CD")->find(3); is( ref($cd->year), 'DateTime', 'year is a DateTime, ok' ); @@ -26,7 +26,7 @@ my $now = DateTime->now; $cd->year( $now ); $cd->update; -($cd) = $schema->class("CD")->search( year => $now->year ); +($cd) = $schema->resultset("CD")->search( year => $now->year ); is( $cd->year->year, $now->year, 'deflate ok' ); # re-test using alternate deflate syntax @@ -36,7 +36,7 @@ $schema->class("CD")->has_a( 'year', 'DateTime', ); # inflation test -$cd = $schema->class("CD")->find(3); +$cd = $schema->resultset("CD")->find(3); is( ref($cd->year), 'DateTime', 'year is a DateTime, ok' ); @@ -47,7 +47,7 @@ $now = DateTime->now; $cd->year( $now ); $cd->update; -($cd) = $schema->class("CD")->search( year => $now->year ); +($cd) = $schema->resultset("CD")->search( year => $now->year ); is( $cd->year->year, $now->year, 'deflate ok' ); } diff --git a/t/run/09update.tl b/t/run/09update.tl index 64b89c0..ff802f0 100644 --- a/t/run/09update.tl +++ b/t/run/09update.tl @@ -6,7 +6,7 @@ BEGIN { plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 3); } -my $art = $schema->class("Artist")->find(1); +my $art = $schema->resultset("Artist")->find(1); isa_ok $art => 'DBICTest::Artist'; diff --git a/t/run/10auto.tl b/t/run/10auto.tl index 2294d6d..6e474a5 100644 --- a/t/run/10auto.tl +++ b/t/run/10auto.tl @@ -6,7 +6,7 @@ plan tests => 2; $schema->class("Artist")->load_components(qw/PK::Auto::SQLite/); # add an artist without primary key to test Auto -my $artist = $schema->class("Artist")->create( { name => 'Auto' } ); +my $artist = $schema->resultset("Artist")->create( { name => 'Auto' } ); $artist->name( 'Auto Change' ); ok($artist->update, 'update on object created without PK ok'); diff --git a/t/run/14mssql.tl b/t/run/14mssql.tl index feb007d..bfb249b 100644 --- a/t/run/14mssql.tl +++ b/t/run/14mssql.tl @@ -10,7 +10,7 @@ plan skip_all, 'Set $ENV{DBICTEST_MSSQL_DSN}, _USER and _PASS to run this test' plan tests => 4; -$schema->class("Schema")->compose_connection( 'MSSQLTest' => $dsn, $user, $pass ); +$schema->resultset("Schema")->compose_connection( 'MSSQLTest' => $dsn, $user, $pass ); my $dbh = MSSQLTest::Artist->storage->dbh; diff --git a/t/run/15limit.tl b/t/run/15limit.tl index 8949158..eca720d 100644 --- a/t/run/15limit.tl +++ b/t/run/15limit.tl @@ -7,7 +7,7 @@ BEGIN { } # test LIMIT -my $it = $schema->class("CD")->search( {}, +my $it = $schema->resultset("CD")->search( {}, { rows => 3, order_by => 'title' } ); @@ -18,7 +18,7 @@ $it->next; is( $it->next, undef, "next past end of resultset ok" ); # test OFFSET -my @cds = $schema->class("CD")->search( {}, +my @cds = $schema->resultset("CD")->search( {}, { rows => 2, offset => 2, order_by => 'year' } @@ -26,7 +26,7 @@ my @cds = $schema->class("CD")->search( {}, is( $cds[0]->title, "Spoonful of bees", "offset ok" ); # test software-based limiting -$it = $schema->class("CD")->search( {}, +$it = $schema->resultset("CD")->search( {}, { rows => 3, software_limit => 1, order_by => 'title' } @@ -37,7 +37,7 @@ $it->next; $it->next; is( $it->next, undef, "software next past end of resultset ok" ); -@cds = $schema->class("CD")->search( {}, +@cds = $schema->resultset("CD")->search( {}, { rows => 2, offset => 2, software_limit => 1, @@ -47,7 +47,7 @@ is( $cds[0]->title, "Spoonful of bees", "software offset ok" ); # based on a failing criteria submitted by waswas # requires SQL::Abstract >= 1.20 -$it = $schema->class("CD")->search( +$it = $schema->resultset("CD")->search( { title => [ -and => { diff --git a/t/run/16joins.tl b/t/run/16joins.tl index 3f90fce..939ae34 100644 --- a/t/run/16joins.tl +++ b/t/run/16joins.tl @@ -52,7 +52,7 @@ $match = 'person child INNER JOIN person father ON ( father.person_id = ' is( $sa->_recurse_from(@j3), $match, 'join 3 (inner join) ok'); -my $rs = $schema->class("CD")->search( +my $rs = $schema->resultset("CD")->search( { 'year' => 2001, 'artist.name' => 'Caterwauler McCrae' }, { from => [ { 'me' => 'cd' }, [ @@ -65,7 +65,7 @@ cmp_ok( $rs->count, '==', 1, "Single record in resultset"); is($rs->first->title, 'Forkful of bees', 'Correct record returned'); -$rs = $schema->class("CD")->search( +$rs = $schema->resultset("CD")->search( { 'year' => 2001, 'artist.name' => 'Caterwauler McCrae' }, { join => 'artist' }); @@ -73,7 +73,7 @@ cmp_ok( $rs->count, '==', 1, "Single record in resultset"); is($rs->first->title, 'Forkful of bees', 'Correct record returned'); -$rs = $schema->class("CD")->search( +$rs = $schema->resultset("CD")->search( { 'artist.name' => 'We Are Goth', 'liner_notes.notes' => 'Kill Yourself!' }, { join => [ qw/artist liner_notes/ ] }); @@ -83,13 +83,13 @@ cmp_ok( $rs->count, '==', 1, "Single record in resultset"); is($rs->first->title, 'Come Be Depressed With Us', 'Correct record returned'); # when using join attribute, make sure slice()ing all objects has same count as all() -$rs = $schema->class("CD")->search( +$rs = $schema->resultset("CD")->search( { 'artist' => 1 }, { join => [qw/artist/], order_by => 'artist.name' } ); cmp_ok( scalar $rs->all, '==', scalar $rs->slice(0, $rs->count - 1), 'slice() with join has same count as all()' ); -$rs = $schema->class("Artist")->search( +$rs = $schema->resultset("Artist")->search( { 'liner_notes.notes' => 'Kill Yourself!' }, { join => { 'cds' => 'liner_notes' } }); @@ -97,7 +97,7 @@ cmp_ok( $rs->count, '==', 1, "Single record in resultset"); is($rs->first->name, 'We Are Goth', 'Correct record returned'); -$rs = $schema->class("CD")->search( +$rs = $schema->resultset("CD")->search( { 'artist.name' => 'Caterwauler McCrae' }, { prefetch => [ qw/artist liner_notes/ ], order_by => 'me.cdid' }); @@ -132,19 +132,19 @@ $trace->close; unlink 't/var/dbic.trace'; is($selects, 1, 'prefetch ran only 1 select statement'); -my ($artist) = $schema->class("Artist")->search({ 'cds.year' => 2001 }, +my ($artist) = $schema->resultset("Artist")->search({ 'cds.year' => 2001 }, { order_by => 'artistid DESC', join => 'cds' }); is($artist->name, 'Random Boy Band', "Join search by object ok"); -my @cds = $schema->class("CD")->search({ 'liner_notes.notes' => 'Buy Merch!' }, +my @cds = $schema->resultset("CD")->search({ 'liner_notes.notes' => 'Buy Merch!' }, { join => 'liner_notes' }); cmp_ok(scalar @cds, '==', 1, "Single CD retrieved via might_have"); is($cds[0]->title, "Generic Manufactured Singles", "Correct CD retrieved"); -my @artists = $schema->class("Artist")->search({ 'tags.tag' => 'Shiny' }, +my @artists = $schema->resultset("Artist")->search({ 'tags.tag' => 'Shiny' }, { join => { 'cds' => 'tags' } }); cmp_ok( @artists, '==', 2, "two-join search ok" ); diff --git a/t/run/17join_count.tl b/t/run/17join_count.tl index 302eefe..08335e0 100644 --- a/t/run/17join_count.tl +++ b/t/run/17join_count.tl @@ -5,19 +5,19 @@ eval "use DBD::SQLite"; plan skip_all => 'needs DBD::SQLite for testing' if $@; plan tests => 4; -cmp_ok($schema->class("CD")->count({ 'artist.name' => 'Caterwauler McCrae' }, +cmp_ok($schema->resultset("CD")->count({ 'artist.name' => 'Caterwauler McCrae' }, { join => 'artist' }), '==', 3, 'Count by has_a ok'); -cmp_ok($schema->class("CD")->count({ 'tags.tag' => 'Blue' }, { join => 'tags' }), +cmp_ok($schema->resultset("CD")->count({ 'tags.tag' => 'Blue' }, { join => 'tags' }), '==', 4, 'Count by has_many ok'); -cmp_ok($schema->class("CD")->count( +cmp_ok($schema->resultset("CD")->count( { 'liner_notes.notes' => { '!=' => undef } }, { join => 'liner_notes' }), '==', 3, 'Count by might_have ok'); -cmp_ok($schema->class("CD")->count( +cmp_ok($schema->resultset("CD")->count( { 'year' => { '>', 1998 }, 'tags.tag' => 'Cheesy', 'liner_notes.notes' => { 'like' => 'Buy%' } }, { join => [ qw/tags liner_notes/ ] } ), diff --git a/t/run/18self_referencial.tl b/t/run/18self_referencial.tl index 5b3861b..b061adb 100644 --- a/t/run/18self_referencial.tl +++ b/t/run/18self_referencial.tl @@ -21,7 +21,7 @@ my $schema = shift; plan tests => 4; -my $item = $schema->class("SelfRef")->find( 1 ); +my $item = $schema->resultset("SelfRef")->find( 1 ); is( $item->name, 'First', 'proper start item' ); my @aliases = $item->aliases; diff --git a/t/run/19uuid.tl b/t/run/19uuid.tl index a877600..0da87f1 100644 --- a/t/run/19uuid.tl +++ b/t/run/19uuid.tl @@ -9,7 +9,7 @@ DBICTest::Schema::Artist->load_components('UUIDColumns'); DBICTest::Schema::Artist->uuid_columns('name'); Class::C3->reinitialize(); -my $artist = $schema->class("Artist")->create( { artistid => 100 } ); +my $artist = $schema->resultset("Artist")->create( { artistid => 100 } ); like $artist->name, qr/[\w-]{36}/, 'got something like uuid'; }