sub run_tests {
my $self = shift;
- plan tests => 157 + ($self->{extra}->{count} || 0);
+ plan tests => 159 + ($self->{extra}->{count} || 0);
$self->create();
$warn_count++ for grep /^Bad table or view/, @loader_warnings;
- $warn_count++ for grep /stripping trailing _id/, @loader_warnings;
+ $warn_count++ for grep /renaming \S+ relation/, @loader_warnings;
my $vendor = $self->{vendor};
$warn_count++ for grep /${vendor}_\S+ has no primary key/,
);
SKIP: {
- skip $self->{skip_rels}, 99 if $self->{skip_rels};
+ skip $self->{skip_rels}, 101 if $self->{skip_rels};
my $moniker3 = $monikers->{loader_test3};
my $class3 = $classes->{loader_test3};
my $rs_rel4 = $obj3->search_related('loader_test4zes');
isa_ok( $rs_rel4->first, $class4);
+ # check rel naming with prepositions
+ ok ($class4->has_relationship('loader_test5s_to'),
+ "rel with preposition 'to' pluralized correctly");
+
+ ok ($class4->has_relationship('loader_test5s_from'),
+ "rel with preposition 'from' pluralized correctly");
+
# find on multi-col pk
my $obj5 =
eval { $rsobj5->find({id1 => 1, iD2 => 1}) } ||
id1 INTEGER NOT NULL,
iD2 INTEGER NOT NULL,
dat VARCHAR(8),
- PRIMARY KEY (id1,iD2)
+ from_id INTEGER,
+ to_id INTEGER,
+ PRIMARY KEY (id1,iD2),
+ FOREIGN KEY (from_id) REFERENCES loader_test4 (id),
+ FOREIGN KEY (to_id) REFERENCES loader_test4 (id)
) $self->{innodb}
},