Implemented "add_unique_constraints".
[dbsrgits/DBIx-Class.git] / t / 65multipk.t
CommitLineData
70350518 1use strict;
2use warnings;
3
4use Test::More;
5use lib qw(t/lib);
6use DBICTest;
7
a47e1233 8my $schema = DBICTest->init_schema();
0567538f 9
5d1d81d6 10plan tests => 5;
70350518 11
c216324a 12my $artist = $schema->resultset("Artist")->find(1);
716b3d29 13ok($artist->find_related('twokeys', {cd => 1}), "find multiple pks using relationships + args");
5d1d81d6 14
15ok($schema->resultset("FourKeys")->search({ foo => 1, bar => 2 })->find({ hello => 3, goodbye => 4 }), "search on partial key followed by a find");
f9db5527 16ok($schema->resultset("FourKeys")->find(1,2,3,4), "find multiple pks without hash");
17ok($schema->resultset("FourKeys")->find(5,4,3,6), "find multiple pks without hash");
9bbd8963 18is($schema->resultset("FourKeys")->find(1,2,3,4)->ID, 'DBICTest::FourKeys|fourkeys|bar=2|foo=1|goodbye=4|hello=3', 'unique object id ok for multiple pks');
1f6715ab 19