revert 45a380dc2d68e828de4011b99f0c3739db5b0707
[dbsrgits/DBIx-Class-Schema-Loader.git] / t / lib / dbixcsl_common_tests.pm
index 3ad36a3..283805d 100644 (file)
@@ -117,8 +117,17 @@ sub run_only_extra_tests {
         $self->drop_extra_tables_only;
 
         my $dbh = $self->dbconnect(1);
-        $dbh->do($_) for @{ $self->{extra}{create} || [] };
-        $dbh->do($self->{data_type_tests}{ddl}) if $self->{data_type_tests}{ddl};
+        {
+            # Silence annoying but harmless postgres "NOTICE:  CREATE TABLE..."
+            local $SIG{__WARN__} = sub {
+                my $msg = shift;
+                warn $msg unless $msg =~ m{^NOTICE:\s+CREATE TABLE};
+            };
+
+
+            $dbh->do($_) for @{ $self->{extra}{create} || [] };
+            $dbh->do($self->{data_type_tests}{ddl}) if $self->{data_type_tests}{ddl};
+        }
         $self->{_created} = 1;
 
         my $file_count = grep /CREATE (?:TABLE|VIEW)/i, @{ $self->{extra}{create} || [] };
@@ -304,11 +313,11 @@ sub test_schema {
     my @columns_lt2 = $class2->columns;
     is_deeply( \@columns_lt2, [ qw/id dat dat2 set_primary_key dbix_class_testcomponent/ ], "Column Ordering" );
 
-    is $class2->column_info('set_primary_key')->{accessor}, 'Set_primary_key',
-        'accessor for column name that conflicts with a result base class method renamed';
+    is $class2->column_info('set_primary_key')->{accessor}, undef,
+        'accessor for column name that conflicts with a result base class method removed';
 
-    is $class2->column_info('dbix_class_testcomponent')->{accessor}, 'Dbix_class_testcomponent',
-        'accessor for column name that conflicts with a component class method renamed';
+    is $class2->column_info('dbix_class_testcomponent')->{accessor}, undef,
+        'accessor for column name that conflicts with a component class method removed';
 
     my %uniq1 = $class1->unique_constraints;
     my $uniq1_test = 0;
@@ -887,7 +896,7 @@ sub test_schema {
             # 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_rescan;
@@ -1052,8 +1061,8 @@ sub create {
                 id $self->{auto_inc_pk},
                 dat VARCHAR(32) NOT NULL,
                 dat2 VARCHAR(32) NOT NULL,
-                set_primary_key INTEGER,
-                dbix_class_testcomponent INTEGER,
+                set_primary_key INTEGER $self->{null},
+                dbix_class_testcomponent INTEGER $self->{null},
                 UNIQUE (dat2, dat)
             ) $self->{innodb}
         },
@@ -1462,7 +1471,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);