generate POD for additional_classes, additional_base_classes, left_base_classes,...
[dbsrgits/DBIx-Class-Schema-Loader.git] / t / 23dumpmore.t
index 35750a3..8da4e1d 100644 (file)
@@ -50,10 +50,10 @@ $t->cleanup;
   close $config_file;
 
   $t->dump_test(
-    classname => 'DBICTest::Schema::_skip_load_external',
+    classname => 'DBICTest::Schema::_config_file',
     options => { config_file => "$config_file" },
     warnings => [
-      qr/Dumping manual schema for DBICTest::Schema::_skip_load_external to directory /,
+      qr/Dumping manual schema for DBICTest::Schema::_config_file to directory /,
       qr/Schema dump completed/,
     ],
     neg_regexes => {
@@ -66,7 +66,7 @@ $t->cleanup;
 
 # proper exception
 $t->dump_test(
-  classname => 'DBICTest::Schema::_skip_load_external',
+  classname => 'DBICTest::Schema::_clashing_monikers',
   test_db_class => 'make_dbictest_db_clashing_monikers',
   error => qr/tables 'bar', 'bars' reduced to the same source moniker 'Bar'/,
 );
@@ -81,7 +81,11 @@ $t->dump_test(
     custom_column_info => sub {
       my ($table, $col, $info) = @_;
       return +{ extra => { is_footext => 1 } } if $col eq 'footext';
-    }
+    },
+    additional_classes => 'TestAdditional',
+    additional_base_classes => 'TestAdditionalBase',
+    left_base_classes => 'TestLeftBase',
+    components => [ 'TestComponent', '+TestComponentFQN' ],
   },
   warnings => [
     qr/Dumping manual schema for DBICTest::DumpMore::1 to directory /,
@@ -94,25 +98,33 @@ $t->dump_test(
     ],
     Foo => [
       qr/package DBICTest::DumpMore::1::Foo;/,
-      qr/=head1 NAME\n\nDBICTest::DumpMore::1::Foo\n\n=cut\n\n/,
-      qr/=head1 ACCESSORS\n\n/,
-      qr/=head2 fooid\n\n  data_type: 'integer'\n  is_auto_increment: 1\n  is_nullable: 0\n\n/,
-      qr/=head2 footext\n\n  data_type: 'text'\n  default_value: 'footext'\n  extra: {is_footext => 1}\n  is_nullable: 1\n\n/,
+      qr/\n=head1 NAME\n\nDBICTest::DumpMore::1::Foo\n\n=cut\n\n/,
+      qr/\n=head1 ADDITIONAL CLASSES USED\n\n=over 4\n\n=item L<TestAdditional>\n\n=back\n\n=cut\n\n/,
+      qr/\n=head1 ADDITIONAL BASE CLASSES\n\n=over 4\n\n=item L<TestAdditionalBase>\n\n=back\n\n=cut\n\n/,
+      qr/\n=head1 LEFT BASE CLASSES\n\n=over 4\n\n=item L<TestLeftBase>\n\n=back\n\n=cut\n\n/,
+      qr/\n=head1 COMPONENTS LOADED\n\n=over 4\n\n=item L<DBIx::Class::TestComponent>\n\n=item L<TestComponentFQN>\n\n=back\n\n=cut\n\n/,
+      qr/\n=head1 ACCESSORS\n\n/,
+      qr/\n=head2 fooid\n\n  data_type: 'integer'\n  is_auto_increment: 1\n  is_nullable: 0\n\n/,
+      qr/\n=head2 footext\n\n  data_type: 'text'\n  default_value: 'footext'\n  extra: {is_footext => 1}\n  is_nullable: 1\n\n/,
       qr/->set_primary_key/,
-      qr/=head1 RELATIONS\n\n/,
-      qr/=head2 bars\n\nType: has_many\n\nRelated object: L<DBICTest::DumpMore::1::Bar>\n\n=cut\n\n/,
+      qr/\n=head1 RELATIONS\n\n/,
+      qr/\n=head2 bars\n\nType: has_many\n\nRelated object: L<DBICTest::DumpMore::1::Bar>\n\n=cut\n\n/,
       qr/1;\n$/,
     ],
     Bar => [
       qr/package DBICTest::DumpMore::1::Bar;/,
-      qr/=head1 NAME\n\nDBICTest::DumpMore::1::Bar\n\n=cut\n\n/,
-      qr/=head1 ACCESSORS\n\n/,
-      qr/=head2 barid\n\n  data_type: 'integer'\n  is_auto_increment: 1\n  is_nullable: 0\n\n/,
-      qr/=head2 fooref\n\n  data_type: 'integer'\n  is_foreign_key: 1\n  is_nullable: 1\n\n/,
+      qr/\n=head1 NAME\n\nDBICTest::DumpMore::1::Bar\n\n=cut\n\n/,
+      qr/\n=head1 ADDITIONAL CLASSES USED\n\n=over 4\n\n=item L<TestAdditional>\n\n=back\n\n=cut\n\n/,
+      qr/\n=head1 ADDITIONAL BASE CLASSES\n\n=over 4\n\n=item L<TestAdditionalBase>\n\n=back\n\n=cut\n\n/,
+      qr/\n=head1 LEFT BASE CLASSES\n\n=over 4\n\n=item L<TestLeftBase>\n\n=back\n\n=cut\n\n/,
+      qr/\n=head1 COMPONENTS LOADED\n\n=over 4\n\n=item L<DBIx::Class::TestComponent>\n\n=item L<TestComponentFQN>\n\n=back\n\n=cut\n\n/,
+      qr/\n=head1 ACCESSORS\n\n/,
+      qr/\n=head2 barid\n\n  data_type: 'integer'\n  is_auto_increment: 1\n  is_nullable: 0\n\n/,
+      qr/\n=head2 fooref\n\n  data_type: 'integer'\n  is_foreign_key: 1\n  is_nullable: 1\n\n/,
       qr/->set_primary_key/,
-      qr/=head1 RELATIONS\n\n/,
-      qr/=head2 fooref\n\nType: belongs_to\n\nRelated object: L<DBICTest::DumpMore::1::Foo>\n\n=cut\n\n/,
-      qr/1;\n$/,
+      qr/\n=head1 RELATIONS\n\n/,
+      qr/\n=head2 fooref\n\nType: belongs_to\n\nRelated object: L<DBICTest::DumpMore::1::Foo>\n\n=cut\n\n/,
+      qr/\n1;\n$/,
     ],
   },
 );
@@ -333,4 +345,18 @@ $t->dump_test(
   error => qr/My::MissingResultBaseClass.*is not installed/,
 );
 
+# test quote_char in connect_info for dbicdump
+$t->dump_test(
+  classname => 'DBICTest::DumpMore::1',
+  extra_connect_info => [
+    '',
+    '',
+    { quote_char => '"' },
+  ],
+  warnings => [
+    qr/Dumping manual schema for DBICTest::DumpMore::1 to directory /,
+    qr/Schema dump completed/,
+  ],
+);
+
 done_testing;