X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F86sqlt.t;h=ad9c4803ab268f912dc3a199c795d1a08d5df485;hb=ad1446da81fb41c67d0b19ebbb00d0ae328233d1;hp=0d3a759984e618f07b952836e19e93bc0037ea9e;hpb=d6c79cb31fbee489d8daa06e9890c828b1381f3b;p=dbsrgits%2FDBIx-Class.git diff --git a/t/86sqlt.t b/t/86sqlt.t index 0d3a759..ad9c480 100644 --- a/t/86sqlt.t +++ b/t/86sqlt.t @@ -10,7 +10,7 @@ plan skip_all => 'SQL::Translator required' if $@; my $schema = DBICTest->init_schema; -plan tests => 56; +plan tests => 60; my $translator = SQL::Translator->new( parser_args => { @@ -176,6 +176,16 @@ my %fk_constraints = ( on_delete => '', on_update => '', }, ], + # ForceForeign + forceforeign => [ + { + 'display' => 'forceforeign->artist', + 'selftable' => 'forceforeign', 'foreigntable' => 'artist', + 'selfcols' => ['artist'], 'foreigncols' => ['artist_id'], + on_delete => '', on_update => '', + }, + ], + ); my %unique_constraints = ( @@ -222,7 +232,6 @@ my %indexes = ( ); my $tschema = $translator->schema(); - # Test that the $schema->sqlt_deploy_hook was called okay and that it removed # the 'link' table ok( !defined($tschema->get_table('link')), "Link table was removed by hook"); @@ -232,6 +241,8 @@ my $constraint = get_constraint('FOREIGN KEY', 'cd', ['title'], 'cd', ['year']); ok( !defined($constraint), 'nonexistent FOREIGN KEY constraint not found' ); $constraint = get_constraint('UNIQUE', 'cd', ['artist']); ok( !defined($constraint), 'nonexistent UNIQUE constraint not found' ); +$constraint = get_constraint('FOREIGN KEY', 'forceforeign', ['cd'], 'cd', ['cdid']); +ok( !defined($constraint), 'forced nonexistent FOREIGN KEY constraint not found' ); for my $expected_constraints (keys %fk_constraints) { for my $expected_constraint (@{ $fk_constraints{$expected_constraints} }) {