/** * Get dashboard model from dashboard entity * * @param Dashboard $dashboard * @return DashboardModel */ public function createDashboardModel(Dashboard $dashboard) { $dashboardName = $dashboard->getName(); if (!empty($dashboardName)) { $dashboardConfig = $this->configProvider->getDashboardConfig($dashboardName); } else { $dashboardConfig = array(); } return new DashboardModel($dashboard, $this->createWidgetCollection($dashboard), $dashboardConfig); }
/** * @expectedException \Oro\Bundle\DashboardBundle\Exception\InvalidConfigurationException */ public function testGetDashboardConfigHasNoKeyException() { $configProvider = new ConfigProvider(array(), $this->eventDispatcher); $configProvider->getDashboardConfig('not found config'); }
/** * @expectedException \Oro\Bundle\DashboardBundle\Exception\InvalidConfigurationException */ public function testGetDashboardConfigHasNoKeyException() { $configProvider = new ConfigProvider(array()); $configProvider->getDashboardConfig('not found config'); }