X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F16xml-parser.t;h=485d3e67d40739372ca092305d7797b141d09390;hb=f38b7673315088c4b699fc1c6c823c441c5387a9;hp=19c61113b51dcbfde800e4898a6e78cf7cd92903;hpb=af858b8a3d8b1677d0ef7cca159f227948c36a2f;p=dbsrgits%2FSQL-Translator.git diff --git a/t/16xml-parser.t b/t/16xml-parser.t index 19c6111..485d3e6 100644 --- a/t/16xml-parser.t +++ b/t/16xml-parser.t @@ -27,7 +27,7 @@ use constant DEBUG => (exists $opt{d} ? 1 : 0); #============================================================================= BEGIN { - maybe_plan(204, 'SQL::Translator::Parser::XML::SQLFairy'); + maybe_plan(212, 'SQL::Translator::Parser::XML::SQLFairy'); } my $testschema = "$Bin/data/xml/schema.xml"; @@ -39,12 +39,21 @@ $sqlt = SQL::Translator->new( add_drop_table => 1, ); die "Can't find test schema $testschema" unless -e $testschema; -my $sql = $sqlt->translate( + +my $sql; +{ + my @w; + local $SIG{__WARN__} = sub { push @w, $_[0] if $_[0] =~ /The database_event tag is deprecated - please use database_events/ }; + + $sql = $sqlt->translate( from => 'XML-SQLFairy', to => 'MySQL', filename => $testschema, -) or die $sqlt->error; -print $sql if DEBUG; + ) or die $sqlt->error; + print $sql if DEBUG; + + ok (@w, 'database_event deprecation warning issued'); +} # Test the schema objs generted from the XML # @@ -220,6 +229,16 @@ schema_ok( $scma, { bar => "baz", }, }, + { + name => 'bar_trigger', + perform_action_when => 'before', + database_events => 'insert,update', + on_table => 'Basic', + action => 'update modified2=timestamp();', + extra => { + hello => "aliens", + }, + }, ], procedures => [