diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2015-09-15 15:51:54 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2015-09-15 15:51:54 +0200 |
commit | 754850f4732845b752e9b2177b78a2bdbc8ae368 (patch) | |
tree | 23f645fadef7653bdb555620bebf9fb0e035c5f5 /apps/files_sharing/tests/api/shareestest.php | |
parent | aa8b1b2894637f3e2692e4d0f189c07dcb150e63 (diff) | |
download | nextcloud-server-754850f4732845b752e9b2177b78a2bdbc8ae368.tar.gz nextcloud-server-754850f4732845b752e9b2177b78a2bdbc8ae368.zip |
Fix status code
Diffstat (limited to 'apps/files_sharing/tests/api/shareestest.php')
-rw-r--r-- | apps/files_sharing/tests/api/shareestest.php | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/apps/files_sharing/tests/api/shareestest.php b/apps/files_sharing/tests/api/shareestest.php index 65354aef8c6..5c5d5b0d309 100644 --- a/apps/files_sharing/tests/api/shareestest.php +++ b/apps/files_sharing/tests/api/shareestest.php @@ -21,10 +21,9 @@ namespace OCA\Files_Sharing\Tests\API; -use Doctrine\DBAL\Connection; -use OC\Share\Constants; use OCA\Files_Sharing\API\Sharees; use OCA\Files_sharing\Tests\TestCase; +use OCP\AppFramework\Http; use OCP\Share; class ShareesTest extends TestCase { @@ -745,24 +744,24 @@ class ShareesTest extends TestCase { // Test invalid pagination [[ 'page' => 0, - ], 402, 'Invalid page'], + ], 'Invalid page'], [[ 'page' => '0', - ], 402, 'Invalid page'], + ], 'Invalid page'], [[ 'page' => -1, - ], 402, 'Invalid page'], + ], 'Invalid page'], // Test invalid perPage [[ 'perPage' => 0, - ], 401, 'Invalid perPage argument'], + ], 'Invalid perPage argument'], [[ 'perPage' => '0', - ], 401, 'Invalid perPage argument'], + ], 'Invalid perPage argument'], [[ 'perPage' => -1, - ], 401, 'Invalid perPage argument'], + ], 'Invalid perPage argument'], ]; } @@ -770,10 +769,9 @@ class ShareesTest extends TestCase { * @dataProvider dataSearchInvalid * * @param array $getData - * @param int $code * @param string $message */ - public function testSearchInvalid($getData, $code, $message) { + public function testSearchInvalid($getData, $message) { $oldGet = $_GET; $_GET = $getData; @@ -805,7 +803,7 @@ class ShareesTest extends TestCase { $ocs = $sharees->search(); $this->assertInstanceOf('\OC_OCS_Result', $ocs); - $this->assertOCSError($ocs, $code, $message); + $this->assertOCSError($ocs, $message); $_GET = $oldGet; } @@ -992,7 +990,7 @@ class ShareesTest extends TestCase { $ocs = $this->invokePrivate($this->sharees, 'searchSharees', ['', null, [], [], 0, 0, false]); $this->assertInstanceOf('\OC_OCS_Result', $ocs); - $this->assertOCSError($ocs, 400, 'Missing itemType'); + $this->assertOCSError($ocs, 'Missing itemType'); } public function dataGetPaginationLink() { @@ -1041,11 +1039,10 @@ class ShareesTest extends TestCase { /** * @param \OC_OCS_Result $ocs - * @param int $code * @param string $message */ - protected function assertOCSError(\OC_OCS_Result $ocs, $code, $message) { - $this->assertSame($code, $ocs->getStatusCode(), 'Expected status code ' . $code); + protected function assertOCSError(\OC_OCS_Result $ocs, $message) { + $this->assertSame(Http::STATUS_BAD_REQUEST, $ocs->getStatusCode(), 'Expected status code 400'); $this->assertSame([], $ocs->getData(), 'Expected that no data is send'); $meta = $ocs->getMeta(); |