Esempio n. 1
0
 public function testGetWidgetOptionsShouldReturnOptionsOfWidgetSpecifiedAsArgument()
 {
     $request = new Request(['_widgetId' => 1]);
     $this->widgetConfigs->setRequest($request);
     $widget = new Widget();
     $this->widgetRepository->expects($this->once())->method('find')->with(2)->will($this->returnValue($widget));
     $options = ['k' => 'v', 'k2' => 'v2'];
     $widget->setOptions($options);
     $this->configProvider->expects($this->once())->method('getWidgetConfig')->willReturn(['configuration' => ['k' => ['type' => 'test'], 'k2' => ['type' => 'test']]]);
     $this->assertEquals(new WidgetOptionBag($options), $this->widgetConfigs->getWidgetOptions(2));
 }