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')); }
public function testClear() { $container = new \Pure\Container(array('something' => 'somebody')); $container->clear(); $this->assertFalse($container->has('something')); }