X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F72pg.t;h=9d379302ea7f339edeaf6336d26f0df6ad46328b;hb=50841788d03e2342a00470eb2f458e717922615b;hp=eda3e03d4c3be34ca8e2532c4c160989114ec087;hpb=c0329273268971824784f239f32c7246e68da9c5;p=dbsrgits%2FDBIx-Class.git diff --git a/t/72pg.t b/t/72pg.t index eda3e03..9d37930 100644 --- a/t/72pg.t +++ b/t/72pg.t @@ -7,11 +7,10 @@ use warnings; use Test::More; use Test::Exception; use Test::Warn; -use Sub::Name; use Config; use DBICTest; use SQL::Abstract 'is_literal_value'; -use DBIx::Class::_Util 'is_exception'; +use DBIx::Class::_Util qw( is_exception set_subname ); my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_PG_${_}" } qw/DSN USER PASS/}; @@ -80,9 +79,14 @@ for my $use_insert_returning ($test_server_supports_insert_returning : (0) ) { - no warnings qw/once redefine/; + # doing it here instead of the actual class to keep the main thing under dfs + # and thus keep catching false positives (so far none, but one never knows) + mro::set_mro("DBICTest::Schema", "c3"); + my $old_connection = DBICTest::Schema->can('connection'); - local *DBICTest::Schema::connection = subname 'DBICTest::Schema::connection' => sub { + + no warnings qw/once redefine/; + local *DBICTest::Schema::connection = set_subname 'DBICTest::Schema::connection' => sub { my $s = shift->$old_connection(@_); $s->storage->_use_insert_returning ($use_insert_returning); $s;