X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2Fdbixcsl_common_tests.pm;h=22dc59dfea161644ef288eefda4cca7bee55b8b7;hb=7b86848108e4505349fa9e1a778ce225fbfddef6;hp=2d76ee0098cb0a2a72a9fd442eb5e42f42e827cb;hpb=7640ef4b86af6164f7883bc71cffa9c0e26e69af;p=dbsrgits%2FDBIx-Class-Schema-Loader.git diff --git a/t/lib/dbixcsl_common_tests.pm b/t/lib/dbixcsl_common_tests.pm index 2d76ee0..22dc59d 100644 --- a/t/lib/dbixcsl_common_tests.pm +++ b/t/lib/dbixcsl_common_tests.pm @@ -88,7 +88,7 @@ sub run_tests { my $extra_count = $self->{extra}{count} || 0; - plan tests => @connect_info * (181 + $extra_count + ($self->{data_type_tests}{test_count} || 0)); + plan tests => @connect_info * (182 + $extra_count + ($self->{data_type_tests}{test_count} || 0)); foreach my $info_idx (0..$#connect_info) { my $info = $connect_info[$info_idx]; @@ -155,7 +155,12 @@ sub drop_extra_tables_only { my $self = shift; my $dbh = $self->dbconnect(0); - $dbh->do($_) for @{ $self->{extra}{pre_drop_ddl} || [] }; + + { + local $SIG{__WARN__} = sub {}; # postgres notices + $dbh->do($_) for @{ $self->{extra}{pre_drop_ddl} || [] }; + } + $dbh->do("DROP TABLE $_") for @{ $self->{extra}{drop} || [] }; foreach my $data_type_table (@{ $self->{data_type_tests}{table_names} || [] }) { @@ -175,6 +180,13 @@ sub setup_schema { my $debug = ($self->{verbose} > 1) ? 1 : 0; + eval <<'EOF'; +require Moose; +require MooseX::NonMoose; +require namespace::autoclean; +EOF + my $use_moose = $@ ? 0 : 1; + my %loader_opts = ( constraint => qr/^(?:\S+\.)?(?:(?:$self->{vendor}|extra)_?)?loader_?test[0-9]+(?!.*_)/i, @@ -193,6 +205,7 @@ sub setup_schema { dump_directory => $DUMP_DIR, datetime_timezone => 'Europe/Berlin', datetime_locale => 'de_DE', + use_moose => $use_moose, %{ $self->{loader_options} || {} }, ); @@ -317,7 +330,7 @@ sub test_schema { isa_ok( $rsobj35, "DBIx::Class::ResultSet" ); my @columns_lt2 = $class2->columns; - is_deeply( \@columns_lt2, [ qw/id dat dat2 set_primary_key dbix_class_testcomponent/ ], "Column Ordering" ); + is_deeply( \@columns_lt2, [ qw/id dat dat2 set_primary_key dbix_class_testcomponent meta/ ], "Column Ordering" ); is $class2->column_info('set_primary_key')->{accessor}, undef, 'accessor for column name that conflicts with a result base class method removed'; @@ -325,6 +338,9 @@ sub test_schema { is $class2->column_info('dbix_class_testcomponent')->{accessor}, undef, 'accessor for column name that conflicts with a component class method removed'; + is $class2->column_info('meta')->{accessor}, undef, + 'accessor for column name that conflicts with Moose removed'; + my %uniq1 = $class1->unique_constraints; my $uniq1_test = 0; foreach my $ucname (keys %uniq1) { @@ -1178,6 +1194,7 @@ sub create { dat2 VARCHAR(32) NOT NULL, set_primary_key INTEGER $self->{null}, dbix_class_testcomponent INTEGER $self->{null}, + meta INTEGER $self->{null}, UNIQUE (dat2, dat) ) $self->{innodb} }, @@ -1703,7 +1720,11 @@ sub drop_tables { my $dbh = $self->dbconnect(0); - $dbh->do($_) for @{ $self->{extra}{pre_drop_ddl} || [] }; + { + local $SIG{__WARN__} = sub {}; # postgres notices + $dbh->do($_) for @{ $self->{extra}{pre_drop_ddl} || [] }; + } + $dbh->do("DROP TABLE $_") for @{ $self->{extra}{drop} || [] }; my $drop_auto_inc = $self->{auto_inc_drop_cb} || sub {}; @@ -1772,6 +1793,7 @@ sub _custom_column_info { my %DATA_TYPE_MULTI_TABLE_OVERRIDES = ( oracle => qr/\blong\b/i, mssql => qr/\b(?:timestamp|rowversion)\b/i, + informix => qr/\b(?:bigserial|serial8)\b/i, ); sub setup_data_type_tests {