diff options
Diffstat (limited to 'apps/encryption/tests/controller/SettingsControllerTest.php')
-rw-r--r-- | apps/encryption/tests/controller/SettingsControllerTest.php | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/apps/encryption/tests/controller/SettingsControllerTest.php b/apps/encryption/tests/controller/SettingsControllerTest.php index 724a01522af..3b30e61a45b 100644 --- a/apps/encryption/tests/controller/SettingsControllerTest.php +++ b/apps/encryption/tests/controller/SettingsControllerTest.php @@ -56,6 +56,9 @@ class SettingsControllerTest extends TestCase { /** @var \PHPUnit_Framework_MockObject_MockObject */ private $ocSessionMock; + /** @var \PHPUnit_Framework_MockObject_MockObject */ + private $utilMock; + protected function setUp() { parent::setUp(); @@ -106,6 +109,10 @@ class SettingsControllerTest extends TestCase { $this->sessionMock = $this->getMockBuilder('OCA\Encryption\Session') ->disableOriginalConstructor()->getMock(); + $this->utilMock = $this->getMockBuilder('OCA\Encryption\Util') + ->disableOriginalConstructor() + ->getMock(); + $this->controller = new SettingsController( 'encryption', $this->requestMock, @@ -115,7 +122,8 @@ class SettingsControllerTest extends TestCase { $this->keyManagerMock, $this->cryptMock, $this->sessionMock, - $this->ocSessionMock + $this->ocSessionMock, + $this->utilMock ); } @@ -234,4 +242,10 @@ class SettingsControllerTest extends TestCase { $data['message']); } + function testSetEncryptHomeStorage() { + $value = true; + $this->utilMock->expects($this->once())->method('setEncryptHomeStorage')->with($value); + $this->controller->setEncryptHomeStorage($value); + } + } |