43b4270e7c0c827be59dc79e13cc372d3b511ab5
[catagits/Catalyst-Runtime.git] / t / lib / CDICompatTestPlugin.pm
1 package CDICompatTestPlugin;
2
3 # This plugin specificially tests an edge case of C::D::I compat,
4 # where you load a plugin which creates an accessor with the same
5 # name as a class data accessor (_config in this case)..
6
7 # This is what happens if you use the authentication back-compat
8 # stuff, as C::A::Plugin::Credential::Password is added to the plugin
9 # list, and that uses base C::A::C::P class, does the mk_accessors.
10
11 # If a class data method called _config hasn't been created in 
12 # MyApp ($app below), then our call to ->config gets our accessor
13 # (rather than the class data one), and we fail..
14
15 use strict;
16 use warnings;
17 use base qw/Class::Accessor::Fast/;
18 __PACKAGE__->mk_accessors(qw/_config/);
19
20 sub setup {
21     my $app = shift;
22
23     $app->config;
24     $app->NEXT::setup(@_);
25 }
26
27 1;