fix t/backcompat/0.04006 tests
Rafael Kitover [Sat, 24 Sep 2011 19:28:04 +0000 (15:28 -0400)]
The Oracle driver no longer lowercases table names from the catalog, and
these names are normalized to upper case. The main common tests alias
the lowercase table names for the monikers and classes hashes for this
case; this commit adds the same code to the t/backcompat/0.04006 common
tests (in lib/dbixcsl_common_tests.pm .)

t/backcompat/0.04006/lib/dbixcsl_common_tests.pm
t/lib/dbixcsl_common_tests.pm

index c45c131..ef8479b 100644 (file)
@@ -93,9 +93,16 @@ sub run_tests {
     my $monikers = {};
     my $classes = {};
     foreach my $source_name ($schema_class->sources) {
-        my $table_name = $schema_class->source($source_name)->from;
+        my $table_name = $schema_class->loader->moniker_to_table->{$source_name};
+
+        my $result_class = $schema_class->source($source_name)->result_class;
+
         $monikers->{$table_name} = $source_name;
-        $classes->{$table_name} = $schema_class . q{::} . $source_name;
+        $classes->{$table_name} = $result_class;
+
+        # some DBs (Firebird, Oracle) uppercase everything
+        $monikers->{lc $table_name} = $source_name;
+        $classes->{lc $table_name} = $result_class;
     }
 
 # for debugging...
index ff5efe6..6f73505 100644 (file)
@@ -1295,7 +1295,7 @@ sub monikers_and_classes {
         $monikers->{$table_name} = $source_name;
         $classes->{$table_name} = $result_class;
 
-        # some DBs (Firebird) uppercase everything
+        # some DBs (Firebird, Oracle) uppercase everything
         $monikers->{lc $table_name} = $source_name;
         $classes->{lc $table_name} = $result_class;
     }