/**
  * @testdox Building a shared object returns the same object whenever requested
  */
 public function testBuildSharedObject()
 {
     $container = new Container();
     $object = $container->buildSharedObject('Joomla\\Tests\\Unit\\DI\\Stub1');
     $this->assertSame($object, $container->get('Joomla\\Tests\\Unit\\DI\\Stub1'));
     $this->assertSame($container->get('Joomla\\Tests\\Unit\\DI\\Stub1'), $container->get('Joomla\\Tests\\Unit\\DI\\Stub1'));
 }
예제 #2
0
 /**
  * Tests the buildSharedObject.
  *
  * @return  void
  *
  * @since   1.0
  */
 public function testBuildSharedObject()
 {
     $object = $this->fixture->buildSharedObject('Joomla\\DI\\Tests\\Stub1');
     $this->assertSame($object, $this->fixture->get('Joomla\\DI\\Tests\\Stub1'), 'Building a shared object should return the same object whenever requested.');
 }