X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Flib%2FCDICompatTestPlugin.pm;fp=t%2Flib%2FCDICompatTestPlugin.pm;h=43b4270e7c0c827be59dc79e13cc372d3b511ab5;hp=0000000000000000000000000000000000000000;hb=85781ad7ed72409d08127c0c23610ecb2de5663a;hpb=def528160d211a56360aaf12efa8765c6c5ffc57 diff --git a/t/lib/CDICompatTestPlugin.pm b/t/lib/CDICompatTestPlugin.pm new file mode 100644 index 0000000..43b4270 --- /dev/null +++ b/t/lib/CDICompatTestPlugin.pm @@ -0,0 +1,27 @@ +package CDICompatTestPlugin; + +# This plugin specificially tests an edge case of C::D::I compat, +# where you load a plugin which creates an accessor with the same +# name as a class data accessor (_config in this case).. + +# This is what happens if you use the authentication back-compat +# stuff, as C::A::Plugin::Credential::Password is added to the plugin +# list, and that uses base C::A::C::P class, does the mk_accessors. + +# If a class data method called _config hasn't been created in +# MyApp ($app below), then our call to ->config gets our accessor +# (rather than the class data one), and we fail.. + +use strict; +use warnings; +use base qw/Class::Accessor::Fast/; +__PACKAGE__->mk_accessors(qw/_config/); + +sub setup { + my $app = shift; + + $app->config; + $app->NEXT::setup(@_); +} + +1;