get rid of an empty trailing hashref if appropriate
[dbsrgits/DBIx-Class-Schema-Loader.git] / t / 22invoke_deprecated_three.t
CommitLineData
996be9ee 1use strict;
2use Test::More tests => 4;
3use lib qw(t/lib);
4use make_dbictest_db;
5
6eval { require DBD::SQLite };
7my $class = $@ ? 'SQLite2' : 'SQLite';
8
9package DBICTest::Schema;
10use base qw/ DBIx::Class::Schema::Loader /;
11
12__PACKAGE__->load_from_connection(
13 relationships => 1,
14 dsn => "dbi:$class:dbname=./t/dbictest.db",
15);
16
17package main;
18
19my $schema_class = 'DBICTest::Schema';
20my $schema = $schema_class->clone;
21isa_ok($schema, 'DBIx::Class::Schema');
22
23my $foo_rs = $schema->resultset('Bar')->search({ barid => 3})->search_related('fooref');
24isa_ok($foo_rs, 'DBIx::Class::ResultSet');
25
26my $foo_first = $foo_rs->first;
27isa_ok($foo_first, 'DBICTest::Schema::Foo');
28
29my $foo_first_text = $foo_first->footext;
30is($foo_first_text, 'This is the text of the only Foo record associated with the Bar with barid 3');
31