my $extra_count = $self->{extra}{count} || 0;
my $col_accessor_map_tests = 6;
- my $num_rescans = 6;
- $num_rescans++ if $self->{vendor} eq 'mssql';
- $num_rescans++ if $self->{vendor} eq 'Firebird';
plan tests => @connect_info *
- (233 + $num_rescans * $col_accessor_map_tests + $extra_count + ($self->{data_type_tests}{test_count} || 0));
+ (233 + $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];
$self->{use_moose} = 1;
}
+ $self->{col_accessor_map_tests_run} = 0;
+
my %loader_opts = (
constraint => $self->CONSTRAINT,
result_namespace => RESULT_NAMESPACE,
col_collision_map => { '^(can)\z' => 'caught_collision_%s' },
rel_collision_map => { '^(set_primary_key)\z' => 'caught_rel_collision_%s' },
relationship_attrs => { many_to_many => { order_by => 'me.id' } },
- col_accessor_map => \&test_col_accessor_map,
+ col_accessor_map => sub { $self->test_col_accessor_map(@_) },
result_components_map => { LoaderTest2X => 'TestComponentForMap', LoaderTest1 => '+TestComponentForMapFQN' },
uniq_to_primary => 1,
%{ $self->{loader_options} || {} },
}
sub test_col_accessor_map {
- my ( $column_name, $default_name, $context, $default_map ) = @_;
+ my ( $self, $column_name, $default_name, $context, $default_map ) = @_;
if( lc($column_name) eq 'crumb_crisp_coating' ) {
- is( $default_name, 'crumb_crisp_coating', 'col_accessor_map was passed the default name' );
- ok( $context->{$_}, "col_accessor_map func was passed the $_" )
- for qw( table table_name table_class table_moniker schema_class );
-
+ unless ($self->{col_accessor_map_tests_run}++) {
+ is( $default_name, 'crumb_crisp_coating', 'col_accessor_map was passed the default name' );
+ ok( $context->{$_}, "col_accessor_map func was passed the $_" )
+ for qw( table table_name table_class table_moniker schema_class );
+ }
return 'trivet';
} else {
return $default_map->({