[Pkg-owncloud-commits] [owncloud] 06/34: Split up unit tests
David Prévot
taffit at moszumanska.debian.org
Wed Mar 11 15:49:35 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag v8.0.0
in repository owncloud.
commit bcae79a85a5cc266c0874e8894b383309dd46388
Author: Roeland Jago Douma <roeland at famdouma.nl>
Date: Wed Feb 4 15:49:20 2015 +0100
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 aa5e58b..daf022c 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 at famdouma.nl>
+ * Copyright (c) 2015 Roeland Jago Douma <roeland at 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
*/
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list