}
my( $rs_from_list ) = $artist->search_related_rs('cds');
-is( ref($rs_from_list), 'DBIx::Class::ResultSet', 'search_related_rs in list context returns rs' );
+isa_ok( $rs_from_list, 'DBIx::Class::ResultSet', 'search_related_rs in list context returns rs' );
( $rs_from_list ) = $artist->cds_rs();
-is( ref($rs_from_list), 'DBIx::Class::ResultSet', 'relation_rs in list context returns rs' );
+isa_ok( $rs_from_list, 'DBIx::Class::ResultSet', 'relation_rs in list context returns rs' );
# count_related
is( $artist->count_related('cds'), 4, 'count_related ok' );
$rs->reset();
# make sure artist contains a related resultset for cds
-is( ref $artist->{related_resultsets}->{cds}, 'DBIx::Class::ResultSet', 'artist has a related_resultset for cds' );
+isa_ok( $artist->{related_resultsets}{cds}, 'DBIx::Class::ResultSet', 'artist has a related_resultset for cds' );
# check if $artist->cds->get_cache is populated
is( scalar @{$artist->cds->get_cache}, 3, 'cache for artist->cds contains correct number of records');
});
- ok( $cd_result && ref $cd_result eq 'DBICTest::CD', "Got Good CD Class");
+ isa_ok( $cd_result, 'DBICTest::CD', "Got Good CD Class");
ok( $cd_result->title eq "TestOneCD1", "Got Expected Title");
my $tracks = $cd_result->tracks;
- ok( ref $tracks eq "DBIx::Class::ResultSet", "Got Expected Tracks ResultSet");
+ isa_ok( $tracks, 'DBIx::Class::ResultSet', 'Got Expected Tracks ResultSet');
foreach my $track ($tracks->all)
{
- ok( $track && ref $track eq 'DBICTest::Track', 'Got Expected Track Class');
+ isa_ok( $track, 'DBICTest::Track', 'Got Expected Track Class');
}
}, 'First create_related pass');
});
- ok( $cd_result && ref $cd_result eq 'DBICTest::CD', "Got Good CD Class");
+ isa_ok( $cd_result, 'DBICTest::CD', "Got Good CD Class");
ok( $cd_result->title eq "TestOneCD2", "Got Expected Title");
ok( $cd_result->notes eq 'I can haz liner notes?', 'Liner notes');
my $tracks = $cd_result->tracks;
- ok( ref $tracks eq "DBIx::Class::ResultSet", "Got Expected Tracks ResultSet");
+ isa_ok( $tracks, 'DBIx::Class::ResultSet', "Got Expected Tracks ResultSet");
foreach my $track ($tracks->all)
{
- ok( $track && ref $track eq 'DBICTest::Track', 'Got Expected Track Class');
+ isa_ok( $track, 'DBICTest::Track', 'Got Expected Track Class');
}
}, 'second create_related with same arguments');
--- /dev/null
+package #hide from pause
+ DBICTest::BaseResult;
+
+use strict;
+use warnings;
+
+use base qw/DBIx::Class/;
+use DBICTest::BaseResultSet;
+
+__PACKAGE__->load_components (qw/Core/);
+__PACKAGE__->table ('bogus');
+__PACKAGE__->resultset_class ('DBICTest::BaseResultSet');
+
+1;
--- /dev/null
+package #hide from pause
+ DBICTest::BaseResultSet;
+
+use strict;
+use warnings;
+
+use base qw/DBIx::Class::ResultSet/;
+
+1;
package # hide from PAUSE
DBICTest::Schema::Artist;
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
__PACKAGE__->table('artist');
__PACKAGE__->source_info({
package # hide from PAUSE
DBICTest::Schema::ArtistUndirectedMap;
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
__PACKAGE__->table('artist_undirected_map');
__PACKAGE__->add_columns(
package # hide from PAUSE
DBICTest::Schema::Artwork;
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
__PACKAGE__->table('cd_artwork');
__PACKAGE__->add_columns(
package # hide from PAUSE
DBICTest::Schema::Artwork_to_Artist;
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
__PACKAGE__->table('artwork_to_artist');
__PACKAGE__->add_columns(
package # hide from PAUSE
DBICTest::Schema::BindType;
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
__PACKAGE__->table('bindtype_test');
package # hide from PAUSE
DBICTest::Schema::Bookmark;
- use base 'DBIx::Class::Core';
+ use base qw/DBICTest::BaseResult/;
use strict;
package # hide from PAUSE \r
DBICTest::Schema::BooksInLibrary;\r
\r
-use base qw/DBIx::Class::Core/;\r
+use base qw/DBICTest::BaseResult/;\r
\r
__PACKAGE__->table('books');\r
__PACKAGE__->add_columns(\r
package # hide from PAUSE
DBICTest::Schema::CD;
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
__PACKAGE__->table('cd');
__PACKAGE__->add_columns(
package # hide from PAUSE
DBICTest::Schema::CD_to_Producer;
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
__PACKAGE__->table('cd_to_producer');
__PACKAGE__->add_columns(
package # hide from PAUSE \r
DBICTest::Schema::Collection;\r
\r
-use base qw/DBIx::Class::Core/;\r
+use base qw/DBICTest::BaseResult/;\r
\r
__PACKAGE__->table('collection');\r
__PACKAGE__->add_columns(\r
package # hide from PAUSE \r
DBICTest::Schema::CollectionObject;\r
\r
-use base qw/DBIx::Class::Core/;\r
+use base qw/DBICTest::BaseResult/;\r
\r
__PACKAGE__->table('collection_object');\r
__PACKAGE__->add_columns(\r
package # hide from PAUSE
DBICTest::Schema::Dummy;
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
use strict;
use warnings;
package # hide from PAUSE
DBICTest::Schema::Employee;
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
__PACKAGE__->load_components(qw( Ordered ));
package # hide from PAUSE
DBICTest::Schema::Encoded;
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
use strict;
use warnings;
use strict;
use warnings;
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
__PACKAGE__->load_components(qw/InflateColumn::DateTime/);
use strict;
use warnings;
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
__PACKAGE__->load_components(qw/InflateColumn::DateTime/);
use strict;
use warnings;
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
__PACKAGE__->load_components(qw/InflateColumn::DateTime/);
use strict;
use warnings;
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
use File::Temp qw/tempdir/;
__PACKAGE__->load_components(qw/InflateColumn::File/);
package # hide from PAUSE
DBICTest::Schema::ForceForeign;
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
__PACKAGE__->table('forceforeign');
__PACKAGE__->add_columns(
package # hide from PAUSE
DBICTest::Schema::FourKeys;
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
__PACKAGE__->table('fourkeys');
__PACKAGE__->add_columns(
package # hide from PAUSE
DBICTest::Schema::FourKeys_to_TwoKeys;
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
__PACKAGE__->table('fourkeys_to_twokeys');
__PACKAGE__->add_columns(
use strict;
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
__PACKAGE__->table('genre');
__PACKAGE__->add_columns(
package # hide from PAUSE
DBICTest::Schema::Image;
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
__PACKAGE__->table('images');
__PACKAGE__->add_columns(
package # hide from PAUSE
DBICTest::Schema::LinerNotes;
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
__PACKAGE__->table('liner_notes');
__PACKAGE__->add_columns(
package # hide from PAUSE
DBICTest::Schema::Link;
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
use strict;
use warnings;
package # hide from PAUSE
DBICTest::Schema::LyricVersion;
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
__PACKAGE__->table('lyric_versions');
__PACKAGE__->add_columns(
package # hide from PAUSE
DBICTest::Schema::Lyrics;
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
__PACKAGE__->table('lyrics');
__PACKAGE__->add_columns(
package # hide from PAUSE
DBICTest::Schema::NoPrimaryKey;
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
__PACKAGE__->table('noprimarykey');
__PACKAGE__->add_columns(
package # hide from PAUSE
DBICTest::Schema::OneKey;
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
__PACKAGE__->table('onekey');
__PACKAGE__->add_columns(
package # hide from PAUSE \r
DBICTest::Schema::Owners;\r
\r
-use base qw/DBIx::Class::Core/;\r
+use base qw/DBICTest::BaseResult/;\r
\r
__PACKAGE__->table('owners');\r
__PACKAGE__->add_columns(\r
package # hide from PAUSE
DBICTest::Schema::Producer;
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
__PACKAGE__->table('producer');
__PACKAGE__->add_columns(
package # hide from PAUSE \r
DBICTest::Schema::SelfRef;\r
\r
-use base 'DBIx::Class::Core';\r
+use base qw/DBICTest::BaseResult/;\r
\r
__PACKAGE__->table('self_ref');\r
__PACKAGE__->add_columns(\r
package # hide from PAUSE \r
DBICTest::Schema::SelfRefAlias;\r
\r
-use base 'DBIx::Class::Core';\r
+use base qw/DBICTest::BaseResult/;\r
\r
__PACKAGE__->table('self_ref_alias');\r
__PACKAGE__->add_columns(\r
package # hide from PAUSE
DBICTest::Schema::SequenceTest;
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
__PACKAGE__->table('sequence_test');
__PACKAGE__->source_info({
package # hide from PAUSE
DBICTest::Schema::Serialized;
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
__PACKAGE__->table('serialized');
__PACKAGE__->add_columns(
package # hide from PAUSE
DBICTest::Schema::Tag;
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
__PACKAGE__->table('tags');
__PACKAGE__->add_columns(
package # hide from PAUSE
DBICTest::Schema::Track;
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
__PACKAGE__->load_components(qw/InflateColumn::DateTime Ordered/);
__PACKAGE__->table('track');
package # hide from PAUSE
DBICTest::Schema::TreeLike;
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
__PACKAGE__->table('treelike');
__PACKAGE__->add_columns(
package # hide from PAUSE
DBICTest::Schema::TwoKeyTreeLike;
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
__PACKAGE__->table('twokeytreelike');
__PACKAGE__->add_columns(
package # hide from PAUSE
DBICTest::Schema::TwoKeys;
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
__PACKAGE__->table('twokeys');
__PACKAGE__->add_columns(
package # hide from PAUSE
DBICTest::Schema::TypedObject;
-use base qw/DBIx::Class::Core/;
+use base qw/DBICTest::BaseResult/;
__PACKAGE__->table('typed_object');
__PACKAGE__->add_columns(
DBICTest::Schema::Year1999CDs;
## Used in 104view.t
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
use DBIx::Class::ResultSource::View;
__PACKAGE__->table_class('DBIx::Class::ResultSource::View');
DBICTest::Schema::Year2000CDs;
## Used in 104view.t
-use base 'DBIx::Class::Core';
+use base qw/DBICTest::BaseResult/;
use DBIx::Class::ResultSource::View;
__PACKAGE__->table_class('DBIx::Class::ResultSource::View');
use DBICTest;
-is(DBICTest::Schema->source('Artist')->resultset_class, 'DBIx::Class::ResultSet', 'default resultset class');
+is(DBICTest::Schema->source('Artist')->resultset_class, 'DBICTest::BaseResultSet', 'default resultset class');
ok(!Class::Inspector->loaded('DBICNSTest::ResultSet::A'), 'custom resultset class not loaded');
DBICTest::Schema->source('Artist')->resultset_class('DBICNSTest::ResultSet::A');
ok(Class::Inspector->loaded('DBICNSTest::ResultSet::A'), 'custom resultset class loaded automatically');