summaryrefslogtreecommitdiffstats
path: root/apps/dav/tests/unit/Connector/Sabre/MaintenancePluginTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/tests/unit/Connector/Sabre/MaintenancePluginTest.php')
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/MaintenancePluginTest.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/dav/tests/unit/Connector/Sabre/MaintenancePluginTest.php b/apps/dav/tests/unit/Connector/Sabre/MaintenancePluginTest.php
index 5a4424cb327..94bd1bb0b37 100644
--- a/apps/dav/tests/unit/Connector/Sabre/MaintenancePluginTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/MaintenancePluginTest.php
@@ -28,6 +28,7 @@ namespace OCA\DAV\Tests\unit\Connector\Sabre;
use OCA\DAV\Connector\Sabre\MaintenancePlugin;
use OCP\IConfig;
+use OCP\IL10N;
use Test\TestCase;
/**
@@ -38,6 +39,8 @@ use Test\TestCase;
class MaintenancePluginTest extends TestCase {
/** @var IConfig */
private $config;
+ /** @var \PHPUnit\Framework\MockObject\Builder\InvocationMocker|\PHPUnit_Framework_MockObject_Builder_InvocationMocker|IL10N */
+ private $l10n;
/** @var MaintenancePlugin */
private $maintenancePlugin;
@@ -45,10 +48,11 @@ class MaintenancePluginTest extends TestCase {
parent::setUp();
$this->config = $this->getMockBuilder(IConfig::class)->getMock();
- $this->maintenancePlugin = new MaintenancePlugin($this->config);
+ $this->l10n = $this->getMockBuilder(IL10N::class)->getMock();
+ $this->maintenancePlugin = new MaintenancePlugin($this->config, $this->l10n);
}
-
+
public function testMaintenanceMode() {
$this->expectException(\Sabre\DAV\Exception\ServiceUnavailable::class);
$this->expectExceptionMessage('System in maintenance mode.');
@@ -58,6 +62,10 @@ class MaintenancePluginTest extends TestCase {
->method('getSystemValueBool')
->with('maintenance')
->willReturn(true);
+ $this->l10n
+ ->expects($this->any())
+ ->method('t')
+ ->willReturnArgument(0);
$this->maintenancePlugin->checkMaintenanceMode();
}