Пример #1
0
 public function testPut()
 {
     $data = ['isExpanded' => 1, 'layoutPosition' => [2, 20]];
     $this->client->request('PUT', $this->getUrl('oro_api_put_dashboard_widget', ['dashboardId' => $this->widget->getDashboard()->getId(), 'widgetId' => $this->widget->getId()]), $data);
     $result = $this->client->getResponse();
     $this->assertEmptyResponseStatusCodeEquals($result, 204);
     $this->em->refresh($this->widget);
     $model = $this->dashboardManager->findWidgetModel($this->widget->getId());
     $this->assertEquals($data['isExpanded'], $model->isExpanded());
     $this->assertEquals($data['layoutPosition'], $this->widget->getLayoutPosition());
     $this->assertEquals($data['layoutPosition'], $model->getLayoutPosition());
 }
Пример #2
0
 public function testFindWidgetModelEmpty()
 {
     $id = 100;
     $this->widgetRepository->expects($this->once())->method('find')->with($id)->will($this->returnValue(null));
     $this->assertNull($this->manager->findWidgetModel($id));
 }