public function testAddWidget() { $widgets = $this->configProvider->getWidgetConfigs(); $widgetNames = array_keys($widgets); $widgetName = $widgetNames[0]; $id = $this->widget->getDashboard()->getId(); $this->client->request('POST', $this->getUrl('oro_api_post_dashboard_widget_add_widget'), array('dashboardId' => $id, 'widgetName' => $widgetName)); $content = $this->getJsonResponseContent($this->client->getResponse(), 200); $this->assertEquals($this->configProvider->getWidgetConfig($widgetName), $content['config']); $this->assertEquals($widgetName, $content['name']); }
/** * Returns filtered list of widget configuration * based on applicable flags and acl * * @return array */ public function getWidgetConfigs() { return $this->filterWidgets($this->configProvider->getWidgetConfigs()); }
public function testGetWidgetConfigs() { $expected = array('label' => 'test label'); $configProvider = new ConfigProvider(array(ConfigProvider::NODE_WIDGET => $expected), $this->eventDispatcher); $this->assertEquals($expected, $configProvider->getWidgetConfigs()); }