X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FTestAppCustomContainer%2FNoSugarContainer.pm;h=0dc9186d3175a126d28d5b478e93100a5a71733f;hb=b32d8169eb676c8b780440083f86dc9b69909dbd;hp=cfb5e36cd6a0cd890a91e73c2e1f63345a34f424;hpb=ced6f9e2e0e0b6e04249634b1ce8455bba9aa959;p=catagits%2FCatalyst-Runtime.git diff --git a/t/lib/TestAppCustomContainer/NoSugarContainer.pm b/t/lib/TestAppCustomContainer/NoSugarContainer.pm index cfb5e36..0dc9186 100644 --- a/t/lib/TestAppCustomContainer/NoSugarContainer.pm +++ b/t/lib/TestAppCustomContainer/NoSugarContainer.pm @@ -8,6 +8,7 @@ extends 'Catalyst::IOC::Container'; sub BUILD { my $self = shift; + warn("Add Bar to model"); $self->get_sub_container('model')->add_service( Catalyst::IOC::ConstructorInjection->new( name => 'Bar', @@ -16,45 +17,46 @@ sub BUILD { dependencies => { application_name => depends_on( '/application_name' ), config => depends_on( '/config' ), - foo => depends_on('/model/Foo'), + foo => depends_on('/model/DefaultSetup'), }, ) ); - $self->get_sub_container('model')->add_service( - # FIXME - i think it should be a ConstructorInjection - # but only BlockInjection gets ctx parameter - Catalyst::IOC::BlockInjection->new( - name => 'Baz', - lifecycle => '+Catalyst::IOC::LifeCycle::Request', - dependencies => [ - Bread::Board::Dependency->new( - service_name => 'foo', - service_path => 'Foo', - - # FIXME - same as above - service_params => { - ctx => +{}, - accept_context_args => [ +{} ], - }, - ), - ], - block => sub { - TestAppCustomContainer::Model::Baz->new(foo => shift->param('foo')); - }, - ) - ); +# $self->get_sub_container('model')->add_service( +# # FIXME - i think it should be a ConstructorInjection +# # but only BlockInjection gets ctx parameter +# Catalyst::IOC::BlockInjection->new( +# name => 'Baz', +# lifecycle => '+Catalyst::IOC::LifeCycle::Request', +# dependencies => [ +# Bread::Board::Dependency->new( +# service_name => 'foo', +# service_path => 'Foo', +# +# # FIXME - same as above +# service_params => { +# ctx => +{}, +# accept_context_args => [ +{} ], +# }, +# ), +# ], +# block => sub { +# TestAppCustomContainer::Model::Baz->new(foo => shift->param('foo')); +# }, +# ) +# ); - $self->get_sub_container('model')->add_service( - Catalyst::IOC::BlockInjection->new( - name => 'Quux', - lifecycle => 'Singleton', - dependencies => [ - depends_on( '/component/model_Quux' ), - ], - block => sub { shift->param('model_Bar') }, - ) - ); +# Broken deps!?! +# $self->get_sub_container('model')->add_service( +# Catalyst::IOC::BlockInjection->new( +# name => 'Quux', +# lifecycle => 'Singleton', +# dependencies => [ +# depends_on( '/component/model_Quux' ), +# ], +# block => sub { shift->param('model_Bar') }, +# ) +# ); $self->get_sub_container('component')->add_service( Catalyst::IOC::ConstructorInjection->new(