private function populateDashboard(DashboardModel $dashboard, ObjectManager $manager)
 {
     $user = $this->getAdminUser($manager);
     $widgetConfiguration = ['ticket_timeline' => [0, 0], 'time_of_response_widget' => [1, 0], 'tickets_by_channels_widget' => [0, 1], 'tickets_by_branches_widget' => [1, 2], 'tickets_by_priority_widget' => [0, 2]];
     foreach ($widgetConfiguration as $name => $position) {
         $widget = new Widget();
         $widget->setDashboard($dashboard->getEntity());
         $widget->setLayoutPosition($position);
         $widget->setName($name);
         $state = new WidgetState();
         $state->setWidget($widget);
         $state->setOwner($user);
         $state->setExpanded(true);
         $manager->persist($widget);
         $manager->persist($state);
     }
 }
Beispiel #2
0
 public function testExpanded()
 {
     $this->assertTrue($this->state->isExpanded());
     $this->assertEquals($this->state, $this->state->setExpanded(false));
     $this->assertEquals(false, $this->state->isExpanded());
 }