public function boot() { $reflClass = new \ReflectionClass(T::clazz()); $reflProp = $reflClass->getProperty('container'); $reflProp->setAccessible(true); $reflProp->setValue(null, $this->container); }
public function setUp() { $this->t = new MockTranslator(); $this->c = $this->createMock('Symfony\\Component\\DependencyInjection\\ContainerInterface'); $this->c->expects($this->atLeastOnce())->method('get')->with($this->equalTo('translator'))->will($this->returnValue($this->t)); $reflClass = new \ReflectionClass(T::clazz()); $this->reflMethod = $reflClass->getProperty('container'); $this->reflMethod->setAccessible(true); $this->reflMethod->setValue(null, $this->c); }
public function testBoot() { $reflProp = new \ReflectionProperty(T::clazz(), 'container'); $reflProp->setAccessible(true); $this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\ContainerInterface', $reflProp->getValue()); }