X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F86sqlt.t;h=76e759d850206c7aea41f7877341ae6f0d604922;hb=33eafbfd322ab48a2697c0ea9fadfb182fb22a36;hp=6435ba9e3dec8cde91779c62d929498b41d6f7e6;hpb=7f3fd2621c5509873aa30e7a68b7dd670421cc86;p=dbsrgits%2FDBIx-Class.git diff --git a/t/86sqlt.t b/t/86sqlt.t index 6435ba9..76e759d 100644 --- a/t/86sqlt.t +++ b/t/86sqlt.t @@ -22,11 +22,10 @@ sub DBICTest::Schema::deployment_statements { return $self->next::method(@_); } -my $schema = DBICTest->init_schema (no_deploy => 1); - # Check deployment statements ctx sensitivity { + my $schema = DBICTest->init_schema (no_deploy => 1); my $not_first_table_creation_re = qr/CREATE TABLE fourkeys_to_twokeys/; my $statements = $schema->deployment_statements; @@ -59,8 +58,7 @@ my $schema = DBICTest->init_schema (no_deploy => 1); $custom_deployment_statements_called = 0; # add a temporary sqlt_deploy_hook to a source - no warnings 'once'; - local *DBICTest::Track::sqlt_deploy_hook = sub { + local $DBICTest::Schema::Track::hook_cb = sub { my ($class, $sqlt_table) = @_; $deploy_hook_called = 1; @@ -74,11 +72,19 @@ my $schema = DBICTest->init_schema (no_deploy => 1); ); }; + my $component_deploy_hook_called = 0; + local $DBICTest::DeployComponent::hook_cb = sub { + $component_deploy_hook_called = 1; + }; + $schema->deploy; # do not remove, this fires the is() test in the callback above ok($deploy_hook_called, 'deploy hook got called'); ok($custom_deployment_statements_called, '->deploy used the schemas deploy_statements method'); + ok($component_deploy_hook_called, 'component deploy hook got called'); } +my $schema = DBICTest->init_schema (no_deploy => 1); + { my $deploy_hook_called = 0; $custom_deployment_statements_called = 0;