2 use Test::More tests => 4;
6 eval { require DBD::SQLite };
7 my $class = $@ ? 'SQLite2' : 'SQLite';
9 package DBICTest::Schema;
10 use base qw/ DBIx::Class::Schema::Loader /;
12 __PACKAGE__->connection("dbi:$class:dbname=./t/dbictest.db");
13 __PACKAGE__->load_from_connection( relationships => 1 );
17 my $schema_class = 'DBICTest::Schema';
18 my $schema = $schema_class->clone;
19 isa_ok($schema, 'DBIx::Class::Schema');
21 my $foo_rs = $schema->resultset('Bar')->search({ barid => 3})->search_related('fooref');
22 isa_ok($foo_rs, 'DBIx::Class::ResultSet');
24 my $foo_first = $foo_rs->first;
25 isa_ok($foo_first, 'DBICTest::Schema::Foo');
27 my $foo_first_text = $foo_first->footext;
28 is($foo_first_text, 'This is the text of the only Foo record associated with the Bar with barid 3');