protected function setUp() { parent::setUp(); $this->configServiceMock = $configServiceMock = $this->getMockBuilder('\\OCA\\EasyBackup\\Service\\ConfigService')->disableOriginalConstructor()->getMock(); $this->container->registerService('ConfigService', function ($c) use($configServiceMock) { return $configServiceMock; }); $this->cut = $this->container->query('ScheduleService'); }
protected function setUp() { parent::setUp(); $this->configServiceMock = $configServiceMock = $this->getMockBuilder('\\OCA\\EasyBackup\\Service\\ConfigService')->disableOriginalConstructor()->getMock(); $this->container->registerService('ConfigService', function ($c) use($configServiceMock) { return $configServiceMock; }); $this->templateResponseMock = $templateResponseMock = $this->getMockBuilder('\\OCP\\AppFramework\\Http\\TemplateResponse')->disableOriginalConstructor()->getMock(); $this->cut = $this->container->query('LogfileviewController'); }
protected function setUp() { parent::setUp(); $this->shellExecRunnableMock = $shellExecRunnableMock = $this->getMockBuilder('\\OCA\\EasyBackup\\ShellExecRunnable')->disableOriginalConstructor()->getMock(); $this->container->registerService('ShellExecRunnable', function ($c) use($shellExecRunnableMock) { return $shellExecRunnableMock; }); $this->cut = new RunOnceJob(); $reflection = new \ReflectionObject($this->cut); $container = $reflection->getProperty('runnable'); $container->setAccessible(true); $container->setValue($this->cut, $this->shellExecRunnableMock); }
protected function setUp() { parent::setUp(); $owncloudConfigMock = $this->getMockBuilder('\\OCP\\IConfig')->disableOriginalConstructor()->getMock(); $this->container->registerService('OwncloudConfig', function ($c) use($owncloudConfigMock) { return $owncloudConfigMock; }); $this->runOnceJobMock = $runOnceJobMock = $this->getMockBuilder('\\OCA\\EasyBackup\\RunOnceJob')->disableOriginalConstructor()->getMock(); $this->container->registerService('RunOnceJob', function ($c) use($runOnceJobMock) { return $runOnceJobMock; }); $this->cut = $this->container->query('ConfigService'); }
protected function setUp() { parent::setUp(); $this->backupServiceMock = $backupServiceMock = $this->getMockBuilder('\\OCA\\EasyBackup\\Service\\BackupService')->disableOriginalConstructor()->getMock(); $this->container->registerService('BackupService', function ($c) use($backupServiceMock) { return $backupServiceMock; }); $this->configServiceMock = $configServiceMock = $this->getMockBuilder('\\OCA\\EasyBackup\\Service\\ConfigService')->disableOriginalConstructor()->getMock(); $this->container->registerService('ConfigService', function ($c) use($configServiceMock) { return $configServiceMock; }); $this->cut = new BackupCommandHandler(); $reflection = new \ReflectionObject($this->cut); $container = $reflection->getProperty('container'); $container->setAccessible(true); $container->setValue($this->cut, $this->container); }
protected function setUp() { parent::setUp(); $this->backupServiceMock = $backupServiceMock = $this->getMockBuilder('\\OCA\\EasyBackup\\Service\\BackupService')->setMethods(array('executeBackup', 'createStatusInformation'))->disableOriginalConstructor()->getMock(); $this->container->registerService('BackupService', function ($c) use($backupServiceMock) { return $backupServiceMock; }); $configMock = $this->getMock('\\OCP\\IConfig'); $this->container->registerService('OwncloudConfig', function ($c) use($configMock) { return $configMock; }); $configServiceMock = $this->getMockBuilder('\\OCA\\EasyBackup\\Service\\ConfigService')->disableOriginalConstructor()->getMock(); $this->container->registerService('ConfigService', function ($c) use($configServiceMock) { return $configServiceMock; }); $this->statusContainerMock = $this->getMockBuilder('\\OCA\\EasyBackup\\StatusContainer')->disableOriginalConstructor()->getMock(); $this->cut = $this->container->query('BackupController'); }
protected function setUp() { parent::setUp(); $configServiceMock = $this->getMockBuilder('\\OCA\\EasyBackup\\Service\\ConfigService')->disableOriginalConstructor()->getMock(); $this->container->registerService('ConfigService', function ($c) use($configServiceMock) { return $configServiceMock; }); $this->backupServiceMock = $backupServiceMock = $this->getMockBuilder('\\OCA\\EasyBackup\\Service\\BackupService')->disableOriginalConstructor()->getMock(); $this->container->registerService('BackupService', function ($c) use($backupServiceMock) { return $backupServiceMock; }); $urlGeneratorMock = $this->getMock('\\OCP\\IURLGenerator'); $this->container->registerService('URLGenerator', function ($c) use($urlGeneratorMock) { return $urlGeneratorMock; }); $this->containerMock = $containerMock = $this->getMockBuilder('\\OC\\AppFramework\\DependencyInjection\\DiContainer')->disableOriginalConstructor()->getMock(); $this->container->registerService('Container', function ($c) use($containerMock) { return $containerMock; }); $this->cut = $this->container->query('PageController'); }
protected function setUp() { parent::setUp(); $this->cut = new BaseControllerInstance('appName', $this->requestMock, $this->loggerMock, $this->responseFactoryMock); }
protected function setUp() { parent::setUp(); $this->cut = $this->container->query('ShellExecRunnable'); }