From 2fae696d35d221a9fb25b90b90b32c35c81fdd45 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Tue, 25 Jul 2017 15:12:49 +0200 Subject: [PATCH] Fix tests Signed-off-by: Roeland Jago Douma --- .../tests/Controller/GroupsControllerTest.php | 1 + tests/Core/Controller/OCSControllerTest.php | 6 +++--- tests/Settings/Controller/CertificateControllerTest.php | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/provisioning_api/tests/Controller/GroupsControllerTest.php b/apps/provisioning_api/tests/Controller/GroupsControllerTest.php index caf6ae109f..344f1fe635 100644 --- a/apps/provisioning_api/tests/Controller/GroupsControllerTest.php +++ b/apps/provisioning_api/tests/Controller/GroupsControllerTest.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 { diff --git a/tests/Core/Controller/OCSControllerTest.php b/tests/Core/Controller/OCSControllerTest.php index 9d0a3dae11..aa2c780f82 100644 --- a/tests/Core/Controller/OCSControllerTest.php +++ b/tests/Core/Controller/OCSControllerTest.php @@ -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')); } diff --git a/tests/Settings/Controller/CertificateControllerTest.php b/tests/Settings/Controller/CertificateControllerTest.php index 36b5715e73..48d34a1542 100644 --- a/tests/Settings/Controller/CertificateControllerTest.php +++ b/tests/Settings/Controller/CertificateControllerTest.php @@ -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()); }