From: Peter Rabbitson Date: Mon, 23 Apr 2012 16:41:28 +0000 (+0200) Subject: Fix more fallout from 9b871b00, centralize the ugly in a base Schema class X-Git-Tag: v0.08197~18 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=27a701f9149192aa5adb55a5cdcc2e34d4acfeeb;p=dbsrgits%2FDBIx-Class.git Fix more fallout from 9b871b00, centralize the ugly in a base Schema class --- diff --git a/t/lib/DBICTest/BaseResult.pm b/t/lib/DBICTest/BaseResult.pm index ea232e2..c732181 100644 --- a/t/lib/DBICTest/BaseResult.pm +++ b/t/lib/DBICTest/BaseResult.pm @@ -4,9 +4,12 @@ package #hide from pause use strict; use warnings; +# must load before any DBIx::Class* namespaces +use DBICTest::RunMode; + +use base 'DBIx::Class::Core'; + #use base qw/DBIx::Class::Relationship::Cascade::Rekey DBIx::Class::Core/; -use base qw/DBIx::Class::Core/; -use DBICTest::BaseResultSet; __PACKAGE__->table ('bogus'); __PACKAGE__->resultset_class ('DBICTest::BaseResultSet'); diff --git a/t/lib/DBICTest/BaseResultSet.pm b/t/lib/DBICTest/BaseResultSet.pm index f484dbf..946219d 100644 --- a/t/lib/DBICTest/BaseResultSet.pm +++ b/t/lib/DBICTest/BaseResultSet.pm @@ -4,7 +4,10 @@ package #hide from pause use strict; use warnings; -use base qw/DBIx::Class::ResultSet/; +# must load before any DBIx::Class* namespaces +use DBICTest::RunMode; + +use base 'DBIx::Class::ResultSet'; sub all_hri { return [ shift->search ({}, { result_class => 'DBIx::Class::ResultClass::HashRefInflator' })->all ]; diff --git a/t/lib/DBICTest/BaseSchema.pm b/t/lib/DBICTest/BaseSchema.pm new file mode 100644 index 0000000..010e3e9 --- /dev/null +++ b/t/lib/DBICTest/BaseSchema.pm @@ -0,0 +1,12 @@ +package #hide from pause + DBICTest::BaseSchema; + +use strict; +use warnings; + +# must load before any DBIx::Class* namespaces +use DBICTest::RunMode; + +use base 'DBIx::Class::Schema'; + +1; diff --git a/t/lib/DBICTest/ResultSetManager.pm b/t/lib/DBICTest/ResultSetManager.pm index 1fafbf0..e53804f 100644 --- a/t/lib/DBICTest/ResultSetManager.pm +++ b/t/lib/DBICTest/ResultSetManager.pm @@ -1,6 +1,6 @@ package # hide from PAUSE DBICTest::ResultSetManager; -use base 'DBIx::Class::Schema'; +use base 'DBICTest::BaseSchema'; __PACKAGE__->load_classes("Foo"); diff --git a/t/lib/DBICTest/Schema.pm b/t/lib/DBICTest/Schema.pm index a4a6d5e..d2d41d0 100644 --- a/t/lib/DBICTest/Schema.pm +++ b/t/lib/DBICTest/Schema.pm @@ -5,7 +5,7 @@ use strict; use warnings; no warnings 'qw'; -use base 'DBIx::Class::Schema'; +use base 'DBICTest::BaseSchema'; use Fcntl qw/:DEFAULT :seek :flock/; use Time::HiRes 'sleep'; diff --git a/t/lib/DBICVersion_v1.pm b/t/lib/DBICVersion_v1.pm index d2e6325..a2cf9f7 100644 --- a/t/lib/DBICVersion_v1.pm +++ b/t/lib/DBICVersion_v1.pm @@ -28,7 +28,7 @@ __PACKAGE__->add_columns __PACKAGE__->set_primary_key('Version'); package DBICVersion::Schema; -use base 'DBIx::Class::Schema'; +use base 'DBICTest::BaseSchema'; use strict; use warnings; diff --git a/t/lib/DBICVersion_v2.pm b/t/lib/DBICVersion_v2.pm index 6f152f1..f103160 100644 --- a/t/lib/DBICVersion_v2.pm +++ b/t/lib/DBICVersion_v2.pm @@ -36,7 +36,7 @@ __PACKAGE__->add_columns __PACKAGE__->set_primary_key('Version'); package DBICVersion::Schema; -use base 'DBIx::Class::Schema'; +use base 'DBICTest::BaseSchema'; use strict; use warnings; diff --git a/t/lib/DBICVersion_v3.pm b/t/lib/DBICVersion_v3.pm index d66b897..8321143 100644 --- a/t/lib/DBICVersion_v3.pm +++ b/t/lib/DBICVersion_v3.pm @@ -44,7 +44,7 @@ __PACKAGE__->add_columns __PACKAGE__->set_primary_key('Version'); package DBICVersion::Schema; -use base 'DBIx::Class::Schema'; +use base 'DBICTest::BaseSchema'; use strict; use warnings; diff --git a/t/lib/ViewDeps.pm b/t/lib/ViewDeps.pm index 6c3a311..e7df0f9 100644 --- a/t/lib/ViewDeps.pm +++ b/t/lib/ViewDeps.pm @@ -4,7 +4,7 @@ package # hide from PAUSE use strict; use warnings; -use base 'DBIx::Class::Schema'; +use base 'DBICTest::BaseSchema'; __PACKAGE__->load_namespaces; diff --git a/t/lib/ViewDepsBad.pm b/t/lib/ViewDepsBad.pm index 9b5be12..97b8868 100644 --- a/t/lib/ViewDepsBad.pm +++ b/t/lib/ViewDepsBad.pm @@ -4,7 +4,7 @@ package # hide from PAUSE use strict; use warnings; -use base 'DBIx::Class::Schema'; +use base 'DBICTest::BaseSchema'; __PACKAGE__->load_namespaces; diff --git a/t/lib/testinclude/DBICTestAdminInc.pm b/t/lib/testinclude/DBICTestAdminInc.pm index cf7f6f9..9f57e2f 100644 --- a/t/lib/testinclude/DBICTestAdminInc.pm +++ b/t/lib/testinclude/DBICTestAdminInc.pm @@ -1,5 +1,5 @@ package DBICTestAdminInc; -use base 'DBIx::Class::Schema'; +use base 'DBICTest::BaseSchema'; sub connect { exit 70 } # this is what the test will expect to see diff --git a/t/lib/testinclude/DBICTestConfig.pm b/t/lib/testinclude/DBICTestConfig.pm index 10f0b7f..d9fa7ed 100644 --- a/t/lib/testinclude/DBICTestConfig.pm +++ b/t/lib/testinclude/DBICTestConfig.pm @@ -1,5 +1,5 @@ package DBICTestConfig; -use base 'DBIx::Class::Schema'; +use base 'DBICTest::BaseSchema'; sub connect { my($self, @opt) = @_;