1 BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
3 $ENV{DBIC_ASSERT_NO_FAILING_SANITY_CHECKS} = 1;
11 use Sub::Quote 'quote_sub';
13 my $colinfo = DBICTest::Schema::Artist->result_source->column_info('artistid');
15 my $schema = DBICTest->init_schema ( no_deploy => 1 );
16 my $rsrc = $schema->source("Artist");
18 for my $overrides_marked_mandatory (0, 1) {
20 my @methods_to_override = qw(
21 add_columns columns_info
24 my $attr = { attributes => [
25 $overrides_marked_mandatory
26 ? 'DBIC_method_is_mandatory_resultsource_proxy'
27 : 'DBIC_method_is_bypassable_resultsource_proxy'
30 for (@methods_to_override) {
31 $call_count->{$_} = 0;
33 quote_sub( "DBICTest::Schema::Artist::$_", <<'EOC', { '$cnt' => \\($call_count->{$_}) }, $attr );
35 shift->next::method(@_);
39 Class::C3->reinitialize() if DBIx::Class::_ENV_::OLD_MRO;
42 $rsrc->columns_info->{artistid},
44 'Expected result from rsrc getter',
47 $rsrc->add_columns("bar");
52 add_columns => ($overrides_marked_mandatory ? 1 : 0),
54 # ResultSourceProxy::add_columns will call colinfos as well
55 columns_info => ($overrides_marked_mandatory ? 2 : 0),
57 'expected rsrc proxy override callcounts',