/** * @testdox getNewInstance() will always return a new instance, even if the resource was set to be shared */ public function testGetNewInstance() { $container = new Container(); $container->share('foo', function () { return new \stdClass(); }); $this->assertNotSame($container->getNewInstance('foo'), $container->getNewInstance('foo')); }
/** * Tests the getNew method which will always return a * new instance, even if the $key was set to be shared. * * @return void * * @since 1.0 */ public function testGetNewInstance() { $this->fixture->set('foo', function () { return new \stdClass(); }); $this->assertNotSame($this->fixture->getNewInstance('foo'), $this->fixture->getNewInstance('foo')); }