Beispiel #1
0
 protected function setUp()
 {
     $this->configProvider = $this->getMockBuilder('Oro\\Bundle\\ChartBundle\\Model\\ConfigProvider')->disableOriginalConstructor()->getMock();
     $mock = $this->getMockBuilder('Oro\\Bundle\\ChartBundle\\Form\\EventListener\\ChartTypeEventListener')->getMock();
     $eventListener = new MutableFormEventSubscriber($mock);
     $this->type = new ChartType($this->configProvider);
     $this->type->setEventListener($eventListener);
     parent::setUp();
 }
 /**
  * @return array
  */
 protected function getExtensions()
 {
     $configProvider = $this->getMockBuilder('\\Oro\\Bundle\\ChartBundle\\Model\\ConfigProvider')->disableOriginalConstructor()->getMock();
     $configProvider->expects($this->atLeastOnce())->method('getChartConfigs')->will($this->returnValue([]));
     $mock = $this->getMockBuilder('Oro\\Bundle\\ChartBundle\\Form\\EventListener\\ChartTypeEventListener')->getMock();
     $eventListener = new MutableFormEventSubscriber($mock);
     $childType = new ChartType($configProvider);
     $childType->setEventListener($eventListener);
     $collectionType = new ChartSettingsCollectionType();
     $schemaCollectionType = new ReportChartSchemaCollectionType($configProvider);
     return [new PreloadedExtension([$childType->getName() => $childType, $collectionType->getName() => $collectionType, $schemaCollectionType->getName() => $schemaCollectionType], [])];
 }