diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2015-02-04 15:49:20 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2015-02-04 15:49:20 +0100 |
commit | bcae79a85a5cc266c0874e8894b383309dd46388 (patch) | |
tree | 0cbe32df0fbd1986c4ad698be9928ff83d0d3d26 | |
parent | 083ebca812ebeb48bfc4aca0e5ff9cd7a6861042 (diff) | |
download | nextcloud-server-bcae79a85a5cc266c0874e8894b383309dd46388.tar.gz nextcloud-server-bcae79a85a5cc266c0874e8894b383309dd46388.zip |
Split up unit tests
-rw-r--r-- | apps/files_sharing/tests/capabilities.php | 40 |
1 files 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 @@ <?php /** - * Copyright (c) Roeland Jago Douma <roeland@famdouma.nl> + * Copyright (c) 2015 Roeland Jago Douma <roeland@famdouma.nl> * 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 */ |