$num_rescans++ if $self->{vendor} eq 'Firebird';
plan tests => @connect_info *
- (188 + $num_rescans * $col_accessor_map_tests + $extra_count + ($self->{data_type_tests}{test_count} || 0));
+ (194 + $num_rescans * $col_accessor_map_tests + $extra_count + ($self->{data_type_tests}{test_count} || 0));
foreach my $info_idx (0..$#connect_info) {
my $info = $connect_info[$info_idx];
col_collision_map => { '^(can)\z' => 'caught_collision_%s' },
rel_collision_map => { '^(set_primary_key)\z' => 'caught_rel_collision_%s' },
col_accessor_map => \&test_col_accessor_map,
+ result_component_map => { LoaderTest2X => 'TestComponentForMap', LoaderTest1 => '+TestComponentForMapFQN' },
%{ $self->{loader_options} || {} },
);
is $class2->column_info('testcomponent_fqn')->{accessor}, undef,
'accessor for column name that conflicts with a fully qualified component class method removed';
- is $class2->column_info('meta')->{accessor}, undef,
- 'accessor for column name that conflicts with Moose removed';
+ if ($conn->_loader->use_moose) {
+ is $class2->column_info('meta')->{accessor}, undef,
+ 'accessor for column name that conflicts with Moose removed';
+ }
+ else {
+ pass "not removing 'meta' accessor with use_moose disabled";
+ }
my %uniq1 = $class1->unique_constraints;
my $uniq1_test = 0;
'Additional Component' );
}
- is ((try { $class1->testcomponent_fqn }), 'TestComponentFQN works',
- 'fully qualified component class');
+ is try { $class2->dbix_class_testcomponentformap }, 'dbix_class_testcomponentformap works',
+ 'component from result_component_map';
+
+ isnt try { $class1->dbix_class_testcomponentformap }, 'dbix_class_testcomponentformap works',
+ 'component from result_component_map not added to not mapped Result';
+
+ is try { $class1->testcomponent_fqn }, 'TestComponentFQN works',
+ 'fully qualified component class';
+
+ is try { $class1->testcomponentformap_fqn }, 'TestComponentForMapFQN works',
+ 'fully qualified component class from result_component_map';
+
+ isnt try { $class2->testcomponentformap_fqn }, 'TestComponentForMapFQN works',
+ 'fully qualified component class from result_component_map not added to not mapped Result';
SKIP: {
can_ok( $class1, 'loader_test1_classmeth' )
'constant negative integer default',
);
- cmp_ok(
- $class35->column_info('a_double')->{default_value}, '==', 10.555,
+ is(
+ sprintf("%.3f", $class35->column_info('a_double')->{default_value}), '10.555',
'constant numeric default',
);
- cmp_ok(
- $class35->column_info('a_negative_double')->{default_value}, '==', -10.555,
+ is(
+ sprintf("%.3f", $class35->column_info('a_negative_double')->{default_value}), -10.555,
'constant negative numeric default',
);
$self->rescan_without_warnings($conn);
if (not $self->{skip_rels}) {
- is try { $conn->resultset('LoaderTest41')->find(1)->loader_test40->foo3_bar }, 'foo',
- 'rel and accessor for mixed-case column name in mixed case table';
+ ok my $row = try { $conn->resultset('LoaderTest41')->find(1) },
+ 'row in mixed-case table';
+ ok my $related_row = try { $row->loader_test40 },
+ 'rel in mixed-case table';
+ is try { $related_row->foo3_bar }, 'foo',
+ 'accessor for mixed-case column name in mixed case table';
}
else {
+ SKIP: { skip 'not testing mixed-case rels with skip_rels', 2 }
+
is try { $conn->resultset('LoaderTest40')->find(1)->foo3_bar }, 'foo',
'accessor for mixed-case column name in mixed case table';
}