Esempio n. 1
0
 /**
  * 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);
 }
Esempio n. 2
0
 /**
  * @expectedException \Oro\Bundle\DashboardBundle\Exception\InvalidConfigurationException
  */
 public function testGetDashboardConfigHasNoKeyException()
 {
     $configProvider = new ConfigProvider(array(), $this->eventDispatcher);
     $configProvider->getDashboardConfig('not found config');
 }
Esempio n. 3
0
 /**
  * @expectedException \Oro\Bundle\DashboardBundle\Exception\InvalidConfigurationException
  */
 public function testGetDashboardConfigHasNoKeyException()
 {
     $configProvider = new ConfigProvider(array());
     $configProvider->getDashboardConfig('not found config');
 }