Browse Source
Fix tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
pull/5847/head
Roeland Jago Douma
8 years ago
No known key found for this signature in database
GPG Key ID: F941078878347C0C
3 changed files with
5 additions and
4 deletions
-
apps/provisioning_api/tests/Controller/GroupsControllerTest.php
-
tests/Core/Controller/OCSControllerTest.php
-
tests/Settings/Controller/CertificateControllerTest.php
|
|
|
@ -28,6 +28,7 @@ namespace OCA\Provisioning_API\Tests\Controller; |
|
|
|
|
|
|
|
use OCA\Provisioning_API\Controller\GroupsController; |
|
|
|
use OCP\IGroupManager; |
|
|
|
use OCP\ILogger; |
|
|
|
use OCP\IUserSession; |
|
|
|
|
|
|
|
class GroupsControllerTest extends \Test\TestCase { |
|
|
|
|
|
|
|
@ -169,7 +169,7 @@ class OCSControllerTest extends TestCase { |
|
|
|
$this->equalTo('wrongpass') |
|
|
|
)->willReturn(false); |
|
|
|
|
|
|
|
$expected = new DataResponse(null, 102); |
|
|
|
$expected = new DataResponse([], 102); |
|
|
|
$expected->throttle(); |
|
|
|
$this->assertEquals($expected, $this->controller->personCheck('user', 'wrongpass')); |
|
|
|
} |
|
|
|
@ -181,7 +181,7 @@ class OCSControllerTest extends TestCase { |
|
|
|
$this->equalTo('wrongpass') |
|
|
|
)->willReturn(false); |
|
|
|
|
|
|
|
$expected = new DataResponse(null, 101); |
|
|
|
$expected = new DataResponse([], 101); |
|
|
|
$this->assertEquals($expected, $this->controller->personCheck('', '')); |
|
|
|
} |
|
|
|
|
|
|
|
@ -192,7 +192,7 @@ class OCSControllerTest extends TestCase { |
|
|
|
->with('NotExistingUser') |
|
|
|
->willReturn(null); |
|
|
|
|
|
|
|
$expected = new DataResponse('User not found', 404); |
|
|
|
$expected = new DataResponse(['User not found'], 404); |
|
|
|
$this->assertEquals($expected, $this->controller->getIdentityProof('NotExistingUser')); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -174,7 +174,7 @@ class CertificateControllerTest extends \Test\TestCase { |
|
|
|
->with(file_get_contents($uploadedFile['tmp_name'], 'badCertificate.crt')) |
|
|
|
->will($this->throwException(new \Exception())); |
|
|
|
|
|
|
|
$expected = new DataResponse('An error occurred.', Http::STATUS_UNPROCESSABLE_ENTITY); |
|
|
|
$expected = new DataResponse(['An error occurred.'], Http::STATUS_UNPROCESSABLE_ENTITY); |
|
|
|
$this->assertEquals($expected, $this->certificateController->addPersonalRootCertificate()); |
|
|
|
} |
|
|
|
|
|
|
|
|