コード例 #1
0
ファイル: DITest.php プロジェクト: panlatent/pure
 public function testArrayAccess()
 {
     $container = new \Pure\Container();
     $di = new \Pure\DI($container, $this->provider);
     $di['object3'] = $this;
     $this->assertTrue($di->has('object3'));
     $this->assertSame($this, $di['object3']);
     $this->assertTrue(isset($di['object3']));
     $this->assertFalse(isset($di['object4']));
     unset($di['object3']);
     $this->assertFalse($container->has('object3'));
     $this->assertFalse($this->provider->has('object3'));
 }
コード例 #2
0
ファイル: ContainerTest.php プロジェクト: panlatent/pure
 public function testClear()
 {
     $container = new \Pure\Container(array('something' => 'somebody'));
     $container->clear();
     $this->assertFalse($container->has('something'));
 }