X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FTestAppCustomContainer%2FNoSugarContainer.pm;h=9027592912d7e8497643970a1b52fe0a09e08a9a;hb=072b618d95788494189bbe1d53549a9c18b187a2;hp=350842be68bd1691d03ecedfed2f5833c48c2ca6;hpb=54f4b8d1e194e2dc00d71677e3d9db03e07e76cd;p=catagits%2FCatalyst-Runtime.git diff --git a/t/lib/TestAppCustomContainer/NoSugarContainer.pm b/t/lib/TestAppCustomContainer/NoSugarContainer.pm index 350842b..9027592 100644 --- a/t/lib/TestAppCustomContainer/NoSugarContainer.pm +++ b/t/lib/TestAppCustomContainer/NoSugarContainer.pm @@ -17,25 +17,38 @@ sub BUILD { catalyst_component_name => 'TestAppCustomContainer::Model::SingletonLifeCycle', dependencies => { application_name => depends_on( '/application_name' ), - foo => depends_on('/model/DefaultSetup'), }, ) ); + warn("Add RequestLifeCycle to model"); $self->get_sub_container('model')->add_service( - # FIXME - i think it should be a ConstructorInjection - # but only BlockInjection gets ctx parameter Catalyst::IOC::ConstructorInjection->new( name => 'RequestLifeCycle', lifecycle => '+Catalyst::IOC::LifeCycle::Request', class => 'TestAppCustomContainer::Model::RequestLifeCycle', + catalyst_component_name => 'TestAppCustomContainer::Model::RequestLifeCycle', dependencies => { application_name => depends_on( '/application_name' ), - foo => depends_on('/model/DefaultSetup'), }, ) ); +# warn("Add DependsOnDefaultSetup to model"); +# $self->get_sub_container('model')->add_service( +# Catalyst::IOC::ConstructorInjection->new( +# name => 'DependsOnDefaultSetup', +# class => 'TestAppCustomContainer::Model::DependsOnDefaultSetup', +# catalyst_component_name => 'TestAppCustomContainer::Model::DependsOnDefaultSetup', +# dependencies => { +# application_name => depends_on( '/application_name' ), +# # FIXME - this is what is blowing up everything: +# # DefaultSetup needs the context. It's not getting it here! +# foo => depends_on('/model/DefaultSetup'), +# }, +# ) +# ); + # Broken deps!?! # $self->get_sub_container('model')->add_service( # Catalyst::IOC::BlockInjection->new( @@ -48,29 +61,29 @@ sub BUILD { # ) # ); - my $fnar_config = $self->resolve(service => 'config')->{'Model::Fnar'} || {}; - $self->get_sub_container('component')->add_service( - Catalyst::IOC::ConstructorInjection->new( - name => 'model_Fnar', - lifecycle => 'Singleton', - class => 'TestAppCustomContainer::External::Class', - dependencies => [ - depends_on( '/application_name' ), - ], - config => $fnar_config, - ) - ); - $self->get_sub_container('model')->add_service( - Catalyst::IOC::BlockInjection->new( - name => 'model_Fnar', - lifecycle => 'Singleton', - dependencies => [ - depends_on( '/config' ), - depends_on( '/component/model_Fnar' ), - ], - block => sub { shift->param('model_Fnar') }, - ) - ); +# my $fnar_config = $self->resolve(service => 'config')->{'Model::Fnar'} || {}; +# $self->get_sub_container('component')->add_service( +# Catalyst::IOC::ConstructorInjection->new( +# name => 'model_Fnar', +# lifecycle => 'Singleton', +# class => 'TestAppCustomContainer::External::Class', +# dependencies => [ +# depends_on( '/application_name' ), +# ], +# config => $fnar_config, +# ) +# ); +# $self->get_sub_container('model')->add_service( +# Catalyst::IOC::BlockInjection->new( +# name => 'model_Fnar', +# lifecycle => 'Singleton', +# dependencies => [ +# depends_on( '/config' ), +# depends_on( '/component/model_Fnar' ), +# ], +# block => sub { shift->param('model_Fnar') }, +# ) +# ); } __PACKAGE__->meta->make_immutable;