No join pruning on a SINGLE TABLE FROM CLAUSE
[dbsrgits/DBIx-Class.git] / t / cdbi / 16-reserved.t
CommitLineData
9bc6db13 1use strict;
2use Test::More;
3
50891152 4use lib 't/cdbi/testlib';
d9bd5195 5use Film;
6use Order;
9bc6db13 7
8Film->has_many(orders => 'Order');
9Order->has_a(film => 'Film');
10
11Film->create_test_film;
12
13my $film = Film->retrieve('Bad Taste');
14isa_ok $film => 'Film';
15
16$film->add_to_orders({ orders => 10 });
17
18my $bto = (Order->search(film => 'Bad Taste'))[0];
19isa_ok $bto => 'Order';
20is $bto->orders, 10, "Correct number of orders";
21
22
23my $infilm = $bto->film;
24isa_ok $infilm, "Film";
25
26is $infilm->id, $film->id, "Orders hasa Film";
d9bd5195 27
28done_testing;