/** * @covers \KJSencha\Frontend\Base::__construct */ public function testConstructorOverloading() { $component = new Base('Ext.Component'); $this->assertEmpty($component->toArray()); $title = 'Test Title'; $component = new Base('Ext.Component', array('title' => $title)); $this->assertArrayHasKey('title', $component->toArray()); $this->assertEquals($title, $component['title']); $component = new Base(array('title' => $title)); $this->assertArrayHasKey('title', $component->toArray()); $this->assertEquals($title, $component['title']); }
/** * Inject required dependencies into the component. * * @param Base $component * @param ServiceLocatorInterface $serviceLocator * @return void */ public function injectDependencies($component, ServiceLocatorInterface $serviceLocator) { if ($component instanceof EventManagerAwareInterface) { $component->setEventManager($serviceLocator->get('EventManager')); } }