Esempio n. 1
0
 public function testDelegateContainer()
 {
     $picotainer = new Picotainer(['instance' => function () {
         return 'value';
     }]);
     $container = new Container();
     $container->delegate($picotainer);
     $container->instance('instance2', $container->get('instance'));
     $this->assertSame('value', $container->get('instance2'));
     $this->assertTrue($container->hasInDelegate('instance'));
     $this->assertFalse($container->hasInDelegate('instance3'));
 }