示例#1
0
 private function createArrayGodfather()
 {
     $container = new ArrayContainer();
     $container->set('godfather.manager', new \PUGX\Godfather\Context\Context('tshirt_manager'));
     $container->set('tshirt_manager', new \PUGX\Godfather\Test\Fixture\TshirtManager());
     $container->set('mug_manager', new \PUGX\Godfather\Test\Fixture\MugManager());
     return new Godfather($container, 'godfather');
 }
示例#2
0
 public function testContainer()
 {
     $container = new ArrayContainer();
     $class = new \stdClass();
     $container->set('std', $class);
     $this->assertEquals($container->get('std'), $class);
     $container->setAlias('std2', 'std');
     $this->assertEquals($container->get('std2'), $class);
     $this->assertTrue($container->has('std'));
     $this->assertTrue($container->has('std2'));
 }