X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fbackcompat%2F0.04006%2Flib%2Fdbixcsl_common_tests.pm;h=c29ed4e4c211ecf5a1956fddf3873ca67cbe716f;hb=9ff235d2b5c3ae8d08097744344bce8f119e709b;hp=0a1e2d74fe3461d905859c1c7f5ac8874c38a545;hpb=1ad8e8c3ce53cba4f8a34e37567ed1187b9e54b8;p=dbsrgits%2FDBIx-Class-Schema-Loader.git diff --git a/t/backcompat/0.04006/lib/dbixcsl_common_tests.pm b/t/backcompat/0.04006/lib/dbixcsl_common_tests.pm index 0a1e2d7..c29ed4e 100644 --- a/t/backcompat/0.04006/lib/dbixcsl_common_tests.pm +++ b/t/backcompat/0.04006/lib/dbixcsl_common_tests.pm @@ -43,7 +43,7 @@ sub _monikerize { sub run_tests { my $self = shift; - plan tests => 98; + plan tests => 97; $self->create(); @@ -84,28 +84,25 @@ sub run_tests { $warn_count++ if grep /Dynamic schema detected/, @loader_warnings; $warn_count++ for grep /^Bad table or view/, @loader_warnings; - if($self->{skip_rels}) { - is(scalar(@loader_warnings), $warn_count) - or diag "Did not get the expected 0 warnings. Warnings are: " - . join('',@loader_warnings); - ok(1); - } - else { - $warn_count++; - is(scalar(@loader_warnings), $warn_count) - or diag "Did not get the expected 1 warning. Warnings are: " - . join('',@loader_warnings); - is(grep(/loader_test9 has no primary key/, @loader_warnings), 1); - } + is(scalar(@loader_warnings), $warn_count) + or diag "Did not get the expected 0 warnings. Warnings are: " + . join('',@loader_warnings); } my $conn = $schema_class->clone; my $monikers = {}; my $classes = {}; foreach my $source_name ($schema_class->sources) { - my $table_name = $schema_class->source($source_name)->from; + my $table_name = $schema_class->loader->moniker_to_table->{$source_name}; + + my $result_class = $schema_class->source($source_name)->result_class; + $monikers->{$table_name} = $source_name; - $classes->{$table_name} = $schema_class . q{::} . $source_name; + $classes->{$table_name} = $result_class; + + # some DBs (Firebird, Oracle) uppercase everything + $monikers->{lc $table_name} = $source_name; + $classes->{lc $table_name} = $result_class; } # for debugging... @@ -439,7 +436,11 @@ sub run_tests { $obj10_2->loader_test11( $obj11->id11() ); $obj10_2->update(); }; - is($@, '', 'No errors after eval{}'); + is($@, '', 'No errors after eval{}') + or do { + diag explain $rsobj10->result_source->relationship_info('loader_test11'); + diag explain $rsobj11->result_source->relationship_info('loader_test10'); + }; SKIP: { skip 'Previous eval block failed', 3