use strict; use warnings; use Test::More tests => 134; use My::Company::Schema; # Creates an empty SQLite DB in memory and deploys the schema to it. my $schema = My::Company::Schema->connect; # set-up some test data my $tblFoo = $schema->resultset('Foo'); my $foo_item_1 = $tblFoo->create({ name => 'item1', # Other fields }); my $foo_item_2 = $tblFoo->create({ name => 'item2', # More fields }); my $bar_item = $foo_item_2->add_to_relation({'key'=>'value'}); # More code to populate the test DB. # Tests: my $found_entry_foo = $tblFoo_rs->big_complex_api_call(); is( $found_entry_foo->id, $bar_item->id, "The correct entry from tblFoo was found" );