public function setUp() { $app = new \OCA\ocUsageCharts\AppInfo\Chart(); $this->container = $app->getContainer(); $this->dataProvider = new ChartDataProvider($this->container, new DataProviderFactory(), new ChartTypeAdapterFactory()); $this->configMock = new \OCA\ocUsageCharts\Entity\ChartConfig(100, new \DateTime(), 'test1', 'StorageUsageLastMonth', 'c3js'); }
public function setUp() { $app = new \OCA\ocUsageCharts\AppInfo\Chart(); $this->container = $app->getContainer(); $this->configRepository = $chartConfigRepository = $this->getMockBuilder('\\OCA\\ocUsageCharts\\Entity\\ChartConfigRepository')->disableOriginalConstructor()->getMock(); $this->container->registerService('ChartConfigRepository', function ($c) use($chartConfigRepository) { return $chartConfigRepository; }); $this->configService = new ChartConfigService($this->configRepository); }
public function setUp() { $app = new \OCA\ocUsageCharts\AppInfo\Chart(); $this->container = $app->getContainer(); $this->configService = $configService = $this->getMockBuilder('\\OCA\\ocUsageCharts\\Service\\ChartConfigService')->disableOriginalConstructor()->getMock(); $this->container->registerService('ChartConfigService', function ($c) use($configService) { return $configService; }); $this->dataProvider = $dataProvider = $this->getMockBuilder('\\OCA\\ocUsageCharts\\Service\\ChartDataProvider')->disableOriginalConstructor()->getMock(); $this->container->registerService('ChartDataProvider', function ($c) use($dataProvider) { return $dataProvider; }); $this->configMock = new \OCA\ocUsageCharts\Entity\ChartConfig(100, new \DateTime(), 'test1', 'StorageUsageCurrent', 'c3js'); $this->chartUpdaterService = new ChartUpdaterService($this->dataProvider, $this->configService); }