diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2015-04-20 17:44:34 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2015-04-20 17:44:34 +0200 |
commit | 3f96662609a93f4da653c5962175ae42f4768fc1 (patch) | |
tree | 21e2d875371e84c9e60a6771c165a6975a6832af /apps/encryption/tests | |
parent | d0a6fb1f2ca7899831b20575f692be2168f942e0 (diff) | |
download | nextcloud-server-3f96662609a93f4da653c5962175ae42f4768fc1.tar.gz nextcloud-server-3f96662609a93f4da653c5962175ae42f4768fc1.zip |
Fix several minor things
Diffstat (limited to 'apps/encryption/tests')
-rw-r--r-- | apps/encryption/tests/controller/SettingsControllerTest.php | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/apps/encryption/tests/controller/SettingsControllerTest.php b/apps/encryption/tests/controller/SettingsControllerTest.php index 37a67652a12..a12773790a9 100644 --- a/apps/encryption/tests/controller/SettingsControllerTest.php +++ b/apps/encryption/tests/controller/SettingsControllerTest.php @@ -19,12 +19,11 @@ * */ - namespace OCA\Encryption\Tests\Controller; - use OCA\Encryption\Controller\SettingsController; use OCA\Encryption\Session; +use OCP\AppFramework\Http; use Test\TestCase; class SettingsControllerTest extends TestCase { @@ -53,7 +52,7 @@ class SettingsControllerTest extends TestCase { /** @var \PHPUnit_Framework_MockObject_MockObject */ private $sessionMock; - public function setUp() { + protected function setUp() { parent::setUp(); @@ -65,7 +64,8 @@ class SettingsControllerTest extends TestCase { $this->l10nMock->expects($this->any()) ->method('t') ->will($this->returnCallback(function($message) { - return $message; })); + return $message; + })); $this->userManagerMock = $this->getMockBuilder('OCP\IUserManager') ->disableOriginalConstructor()->getMock(); @@ -85,7 +85,7 @@ class SettingsControllerTest extends TestCase { 'logout', 'setUser', 'getUser', - 'canChangePassword' + 'canChangePassword', ]) ->getMock(); @@ -129,6 +129,7 @@ class SettingsControllerTest extends TestCase { $data = $result->getData(); + $this->assertSame(Http::STATUS_BAD_REQUEST, $result->getStatus()); $this->assertSame('The current log-in password was not correct, please try again.', $data['data']['message']); } @@ -155,6 +156,7 @@ class SettingsControllerTest extends TestCase { $data = $result->getData(); + $this->assertSame(Http::STATUS_BAD_REQUEST, $result->getStatus()); $this->assertSame('The old password was not correct, please try again.', $data['data']['message']); } @@ -212,8 +214,7 @@ class SettingsControllerTest extends TestCase { $data = $result->getData(); - $this->assertSame('success', $data['status']); - + $this->assertSame(Http::STATUS_OK, $result->getStatus()); $this->assertSame('Private key password successfully updated.', $data['data']['message']); } |