/**
  * {@inheritdoc}
  */
 public function reset()
 {
     if (interface_exists('Symfony\\Component\\DependencyInjection\\ResettableContainerInterface') && $this instanceof \Symfony\Component\DependencyInjection\ResettableContainerInterface) {
         parent::reset();
     }
     $this->mocked = array();
 }
Esempio n. 2
0
 /**
  * @group legacy
  */
 public function testResetAfterLeavingScope()
 {
     $c = new Container();
     $c->addScope(new Scope('foo'));
     $c->set('bar', new \stdClass());
     $c->enterScope('foo');
     $c->leaveScope('foo');
     $c->reset();
     $this->assertNull($c->get('bar', ContainerInterface::NULL_ON_INVALID_REFERENCE));
 }
 public function testReset()
 {
     $c = new Container();
     $c->set('bar', new \stdClass());
     $c->reset();
     $this->assertNull($c->get('bar', ContainerInterface::NULL_ON_INVALID_REFERENCE));
 }