/** * @testdox Resources from an arbitrary Interop compatible container are 'shared' and 'protected' */ public function testDecorateArbitraryInteropContainerModes() { $container = new Container(new \ArbitraryInteropContainer()); $this->assertTrue($container->isShared('aic_foo'), "'aic_foo' is expected to be shared"); $this->assertTrue($container->isProtected('aic_foo'), "'aic_foo' is expected to be protected"); }
/** * @testdox The convenience method share() sets resources as protected when passed true as third arg */ public function testShareProtected() { $container = new Container(); $container->share('foo', function () { return new \StdClass(); }, true); $this->assertTrue($container->isShared('foo')); $this->assertTrue($container->isProtected('foo')); }