From bcae79a85a5cc266c0874e8894b383309dd46388 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 4 Feb 2015 15:49:20 +0100 Subject: Split up unit tests --- apps/files_sharing/tests/capabilities.php | 40 ++++++++++++++++++------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/apps/files_sharing/tests/capabilities.php b/apps/files_sharing/tests/capabilities.php index aa5e58ba320..daf022caea2 100644 --- a/apps/files_sharing/tests/capabilities.php +++ b/apps/files_sharing/tests/capabilities.php @@ -1,18 +1,18 @@ + * Copyright (c) 2015 Roeland Jago Douma * This file is licensed under the Affero General Public License version 3 or * later. * See the COPYING-README file. */ -use OCA\Files\Share; +use OCA\Files\Share\Tests; use OCA\Files_sharing\Tests\TestCase; /** * Class Test_Files_Sharing_Capabilties */ -class Test_Files_Sharing_Capabilities extends \PHPUnit_Framework_TestCase { +class Test_Files_Sharing_Capabilities extends \Test\TestCase { /** * Test for the general part in each return statement and assert @@ -48,19 +48,18 @@ class Test_Files_Sharing_Capabilities extends \PHPUnit_Framework_TestCase { /** * @covers OCA\Files_Sharing\Capabilities::getCaps */ - public function testCapabilities() { - /* - * Test for no link sharing - */ + public function test_no_link_sharing() { $map = array( array('core', 'shareapi_allow_links', 'yes', 'no') ); $result = $this->getResults($map); $this->assertEmpty($result); + } - /* - * Test only link sharing - */ + /** + * @covers OCA\Files_Sharing\Capabilities::getCaps + */ + public function test_only_link_sharing() { $map = array( array('core', 'shareapi_allow_links', 'yes', 'yes'), array('core', 'shareapi_enforce_links_password', 'yes', 'no'), @@ -69,10 +68,12 @@ class Test_Files_Sharing_Capabilities extends \PHPUnit_Framework_TestCase { $result = $this->getSharing($this->getResults($map)); $this->assertCount(1, $result); $this->assertArrayHasKey('allow_links', $result); + } - /* - * Test link sharing with enforced passwords - */ + /** + * @covers OCA\Files_Sharing\Capabilities::getCaps + */ + public function test_link_sharing_password() { $map = array( array('core', 'shareapi_allow_links', 'yes', 'yes'), array('core', 'shareapi_enforce_links_password', 'yes', 'yes'), @@ -82,10 +83,12 @@ class Test_Files_Sharing_Capabilities extends \PHPUnit_Framework_TestCase { $this->assertCount(2, $result); $this->assertArrayHasKey('allow_links', $result); $this->assertArrayHasKey('enforce_links_password', $result); + } - /* - * Test link sharing with public upload - */ + /** + * @covers OCA\Files_Sharing\Capabilities::getCaps + */ + public function test_link_sharing_public_uploads() { $map = array( array('core', 'shareapi_allow_links', 'yes', 'yes'), array('core', 'shareapi_enforce_links_password', 'yes', 'no'), @@ -95,7 +98,12 @@ class Test_Files_Sharing_Capabilities extends \PHPUnit_Framework_TestCase { $this->assertCount(2, $result); $this->assertArrayHasKey('allow_links', $result); $this->assertArrayHasKey('allow_public_upload', $result); + } + /** + * @covers OCA\Files_Sharing\Capabilities::getCaps + */ + public function test_link_sharing_all() { /* * Test link sharing with all options on */ -- cgit v1.2.3