upload 0.05003
[dbsrgits/DBIx-Class-Schema-Loader.git] / t / backcompat / 0.04006 / lib / dbixcsl_common_tests.pm
index e4e2517..66b4d5a 100644 (file)
@@ -43,7 +43,7 @@ sub _monikerize {
 sub run_tests {
     my $self = shift;
 
-    plan tests => 88;
+    plan tests => 89;
 
     $self->create();
 
@@ -88,6 +88,8 @@ sub run_tests {
 
         my $warn_count = 0;
         $warn_count++ if grep /ResultSetManager/, @loader_warnings;
+        $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)
@@ -182,10 +184,7 @@ sub run_tests {
         can_ok( $class1, 'dbix_class_testcomponent' ) or $skip_tcomp = 1;
         can_ok( $class1, 'loader_test1_classmeth' ) or $skip_cmeth = 1;
 
-        TODO: {
-            local $TODO = "Not yet supported by ResultSetManger code";
-            can_ok( $rsobj1, 'loader_test1_rsmeth' ) or $skip_rsmeth = 1;
-        }
+        can_ok( $rsobj1, 'loader_test1_rsmeth' ) or $skip_rsmeth = 1;
 
         SKIP: {
             skip "Pre-requisite test failed", 1 if $skip_tab;
@@ -445,7 +444,7 @@ sub run_tests {
         }
 
         SKIP: {
-            skip 'This vendor cannot do inline relationship definitions', 5
+            skip 'This vendor cannot do inline relationship definitions', 6
                 if $self->{no_inline_rels};
 
             my $moniker12 = $monikers->{loader_test12};
@@ -463,6 +462,9 @@ sub run_tests {
             isa_ok( $obj13->id, $class12 );
             isa_ok( $obj13->loader_test12, $class12);
             isa_ok( $obj13->dat, $class12);
+
+            my $obj12 = $rsobj12->find(1);
+            isa_ok( $obj12->loader_test13_ids, "DBIx::Class::ResultSet" );
         }
 
         SKIP: {
@@ -500,9 +502,17 @@ sub run_tests {
             q{ INSERT INTO loader_test30 (id,loader_test2) VALUES(321, 2) },
         );
 
-        my $dbh = $self->dbconnect(1);
-        $dbh->do($_) for @statements_rescan;
-        $dbh->disconnect;
+        {
+            # Silence annoying but harmless postgres "NOTICE:  CREATE TABLE..."
+            local $SIG{__WARN__} = sub {
+                my $msg = shift;
+                warn $msg unless $msg =~ m{^NOTICE:\s+CREATE TABLE};
+            };
+
+            my $dbh = $self->dbconnect(1);
+            $dbh->do($_) for @statements_rescan;
+            $dbh->disconnect;
+        }
 
         my @new = $conn->rescan;
         is(scalar(@new), 1);
@@ -852,7 +862,7 @@ sub create {
     # Silence annoying but harmless postgres "NOTICE:  CREATE TABLE..."
     local $SIG{__WARN__} = sub {
         my $msg = shift;
-        print STDERR $msg unless $msg =~ m{^NOTICE:\s+CREATE TABLE};
+        warn $msg unless $msg =~ m{^NOTICE:\s+CREATE TABLE};
     };
 
     $dbh->do($_) for (@statements);