diff options
Diffstat (limited to 'apps/files_sharing/tests/capabilities.php')
-rw-r--r-- | apps/files_sharing/tests/capabilities.php | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/apps/files_sharing/tests/capabilities.php b/apps/files_sharing/tests/capabilities.php index f1a9626db9b..cff7bdf1fe8 100644 --- a/apps/files_sharing/tests/capabilities.php +++ b/apps/files_sharing/tests/capabilities.php @@ -56,8 +56,31 @@ class FilesSharingCapabilitiesTest extends \Test\TestCase { return $result; } + public function testEnabledSharingAPI() { + $map = [ + ['core', 'shareapi_enabled', 'yes', 'yes'], + ]; + $result = $this->getResults($map); + $this->assertTrue($result['api_enabled']); + $this->assertContains('public', $result); + $this->assertContains('user', $result); + $this->assertContains('resharing', $result); + } + + public function testDisabledSharingAPI() { + $map = [ + ['core', 'shareapi_enabled', 'yes', 'no'], + ]; + $result = $this->getResults($map); + $this->assertFalse($result['api_enabled']); + $this->assertNotContains('public', $result); + $this->assertNotContains('user', $result); + $this->assertNotContains('resharing', $result); + } + public function testNoLinkSharing() { $map = [ + ['core', 'shareapi_enabled', 'yes', 'yes'], ['core', 'shareapi_allow_links', 'yes', 'no'], ]; $result = $this->getResults($map); @@ -67,6 +90,7 @@ class FilesSharingCapabilitiesTest extends \Test\TestCase { public function testOnlyLinkSharing() { $map = [ + ['core', 'shareapi_enabled', 'yes', 'yes'], ['core', 'shareapi_allow_links', 'yes', 'yes'], ]; $result = $this->getResults($map); @@ -76,6 +100,7 @@ class FilesSharingCapabilitiesTest extends \Test\TestCase { public function testLinkPassword() { $map = [ + ['core', 'shareapi_enabled', 'yes', 'yes'], ['core', 'shareapi_allow_links', 'yes', 'yes'], ['core', 'shareapi_enforce_links_password', 'no', 'yes'], ]; @@ -87,6 +112,7 @@ class FilesSharingCapabilitiesTest extends \Test\TestCase { public function testLinkNoPassword() { $map = [ + ['core', 'shareapi_enabled', 'yes', 'yes'], ['core', 'shareapi_allow_links', 'yes', 'yes'], ['core', 'shareapi_enforce_links_password', 'no', 'no'], ]; @@ -98,6 +124,7 @@ class FilesSharingCapabilitiesTest extends \Test\TestCase { public function testLinkNoExpireDate() { $map = [ + ['core', 'shareapi_enabled', 'yes', 'yes'], ['core', 'shareapi_allow_links', 'yes', 'yes'], ['core', 'shareapi_default_expire_date', 'no', 'no'], ]; @@ -109,6 +136,7 @@ class FilesSharingCapabilitiesTest extends \Test\TestCase { public function testLinkExpireDate() { $map = [ + ['core', 'shareapi_enabled', 'yes', 'yes'], ['core', 'shareapi_allow_links', 'yes', 'yes'], ['core', 'shareapi_default_expire_date', 'no', 'yes'], ['core', 'shareapi_expire_after_n_days', '7', '7'], @@ -124,6 +152,7 @@ class FilesSharingCapabilitiesTest extends \Test\TestCase { public function testLinkExpireDateEnforced() { $map = [ + ['core', 'shareapi_enabled', 'yes', 'yes'], ['core', 'shareapi_allow_links', 'yes', 'yes'], ['core', 'shareapi_default_expire_date', 'no', 'yes'], ['core', 'shareapi_enforce_expire_date', 'no', 'yes'], @@ -136,6 +165,7 @@ class FilesSharingCapabilitiesTest extends \Test\TestCase { public function testLinkSendMail() { $map = [ + ['core', 'shareapi_enabled', 'yes', 'yes'], ['core', 'shareapi_allow_links', 'yes', 'yes'], ['core', 'shareapi_allow_public_notification', 'no', 'yes'], ]; @@ -145,6 +175,7 @@ class FilesSharingCapabilitiesTest extends \Test\TestCase { public function testLinkNoSendMail() { $map = [ + ['core', 'shareapi_enabled', 'yes', 'yes'], ['core', 'shareapi_allow_links', 'yes', 'yes'], ['core', 'shareapi_allow_public_notification', 'no', 'no'], ]; @@ -154,6 +185,7 @@ class FilesSharingCapabilitiesTest extends \Test\TestCase { public function testUserSendMail() { $map = [ + ['core', 'shareapi_enabled', 'yes', 'yes'], ['core', 'shareapi_allow_mail_notification', 'no', 'yes'], ]; $result = $this->getResults($map); @@ -162,6 +194,7 @@ class FilesSharingCapabilitiesTest extends \Test\TestCase { public function testUserNoSendMail() { $map = [ + ['core', 'shareapi_enabled', 'yes', 'yes'], ['core', 'shareapi_allow_mail_notification', 'no', 'no'], ]; $result = $this->getResults($map); @@ -170,6 +203,7 @@ class FilesSharingCapabilitiesTest extends \Test\TestCase { public function testResharing() { $map = [ + ['core', 'shareapi_enabled', 'yes', 'yes'], ['core', 'shareapi_allow_resharing', 'yes', 'yes'], ]; $result = $this->getResults($map); @@ -178,6 +212,7 @@ class FilesSharingCapabilitiesTest extends \Test\TestCase { public function testNoResharing() { $map = [ + ['core', 'shareapi_enabled', 'yes', 'yes'], ['core', 'shareapi_allow_resharing', 'yes', 'no'], ]; $result = $this->getResults($map); @@ -186,6 +221,7 @@ class FilesSharingCapabilitiesTest extends \Test\TestCase { public function testLinkPublicUpload() { $map = [ + ['core', 'shareapi_enabled', 'yes', 'yes'], ['core', 'shareapi_allow_links', 'yes', 'yes'], ['core', 'shareapi_allow_public_upload', 'yes', 'yes'], ]; @@ -195,6 +231,7 @@ class FilesSharingCapabilitiesTest extends \Test\TestCase { public function testLinkNoPublicUpload() { $map = [ + ['core', 'shareapi_enabled', 'yes', 'yes'], ['core', 'shareapi_allow_links', 'yes', 'yes'], ['core', 'shareapi_allow_public_upload', 'yes', 'no'], ]; |