aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/tests/Sabre/DAVACL/ACLMethodTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/DAVACL/ACLMethodTest.php')
-rw-r--r--vendor/sabre/dav/tests/Sabre/DAVACL/ACLMethodTest.php86
1 files changed, 38 insertions, 48 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/DAVACL/ACLMethodTest.php b/vendor/sabre/dav/tests/Sabre/DAVACL/ACLMethodTest.php
index 7d7a54d06..3627991bf 100644
--- a/vendor/sabre/dav/tests/Sabre/DAVACL/ACLMethodTest.php
+++ b/vendor/sabre/dav/tests/Sabre/DAVACL/ACLMethodTest.php
@@ -1,38 +1,39 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\DAVACL;
use Sabre\DAV;
use Sabre\HTTP;
-class ACLMethodTest extends \PHPUnit_Framework_TestCase {
-
+class ACLMethodTest extends \PHPUnit\Framework\TestCase
+{
/**
- * @expectedException Sabre\DAV\Exception\BadRequest
+ * @expectedException \Sabre\DAV\Exception\BadRequest
*/
- function testCallback() {
-
+ public function testCallback()
+ {
$acl = new Plugin();
$server = new DAV\Server();
$server->addPlugin(new DAV\Auth\Plugin());
$server->addPlugin($acl);
$acl->httpAcl($server->httpRequest, $server->httpResponse);
-
}
/**
/**
- * @expectedException Sabre\DAV\Exception\MethodNotAllowed
+ * @expectedException \Sabre\DAV\Exception\MethodNotAllowed
*/
- function testNotSupportedByNode() {
-
+ public function testNotSupportedByNode()
+ {
$tree = [
new DAV\SimpleCollection('test'),
];
$acl = new Plugin();
$server = new DAV\Server($tree);
- $server->httpRequest = new HTTP\Request();
+ $server->httpRequest = new HTTP\Request('GET', '/');
$body = '<?xml version="1.0"?>
<d:acl xmlns:d="DAV:">
</d:acl>';
@@ -41,17 +42,16 @@ class ACLMethodTest extends \PHPUnit_Framework_TestCase {
$server->addPlugin($acl);
$acl->httpACL($server->httpRequest, $server->httpResponse);
-
}
- function testSuccessSimple() {
-
+ public function testSuccessSimple()
+ {
$tree = [
new MockACLNode('test', []),
];
$acl = new Plugin();
$server = new DAV\Server($tree);
- $server->httpRequest = new HTTP\Request();
+ $server->httpRequest = new HTTP\Request('GET', '/');
$server->httpRequest->setUrl('/test');
$body = '<?xml version="1.0"?>
@@ -62,14 +62,13 @@ class ACLMethodTest extends \PHPUnit_Framework_TestCase {
$server->addPlugin($acl);
$this->assertFalse($acl->httpACL($server->httpRequest, $server->httpResponse));
-
}
/**
- * @expectedException Sabre\DAVACL\Exception\NotRecognizedPrincipal
+ * @expectedException \Sabre\DAVACL\Exception\NotRecognizedPrincipal
*/
- function testUnrecognizedPrincipal() {
-
+ public function testUnrecognizedPrincipal()
+ {
$tree = [
new MockACLNode('test', []),
];
@@ -88,14 +87,13 @@ class ACLMethodTest extends \PHPUnit_Framework_TestCase {
$server->addPlugin($acl);
$acl->httpACL($server->httpRequest, $server->httpResponse);
-
}
/**
- * @expectedException Sabre\DAVACL\Exception\NotRecognizedPrincipal
+ * @expectedException \Sabre\DAVACL\Exception\NotRecognizedPrincipal
*/
- function testUnrecognizedPrincipal2() {
-
+ public function testUnrecognizedPrincipal2()
+ {
$tree = [
new MockACLNode('test', []),
new DAV\SimpleCollection('principals', [
@@ -117,14 +115,13 @@ class ACLMethodTest extends \PHPUnit_Framework_TestCase {
$server->addPlugin($acl);
$acl->httpACL($server->httpRequest, $server->httpResponse);
-
}
/**
- * @expectedException Sabre\DAVACL\Exception\NotSupportedPrivilege
+ * @expectedException \Sabre\DAVACL\Exception\NotSupportedPrivilege
*/
- function testUnknownPrivilege() {
-
+ public function testUnknownPrivilege()
+ {
$tree = [
new MockACLNode('test', []),
];
@@ -143,20 +140,19 @@ class ACLMethodTest extends \PHPUnit_Framework_TestCase {
$server->addPlugin($acl);
$acl->httpACL($server->httpRequest, $server->httpResponse);
-
}
/**
- * @expectedException Sabre\DAVACL\Exception\NoAbstract
+ * @expectedException \Sabre\DAVACL\Exception\NoAbstract
*/
- function testAbstractPrivilege() {
-
+ public function testAbstractPrivilege()
+ {
$tree = [
new MockACLNode('test', []),
];
$acl = new Plugin();
$server = new DAV\Server($tree);
- $server->on('getSupportedPrivilegeSet', function($node, &$supportedPrivilegeSet) {
+ $server->on('getSupportedPrivilegeSet', function ($node, &$supportedPrivilegeSet) {
$supportedPrivilegeSet['{DAV:}foo'] = ['abstract' => true];
});
$server->httpRequest = new HTTP\Request('ACL', '/test');
@@ -172,14 +168,13 @@ class ACLMethodTest extends \PHPUnit_Framework_TestCase {
$server->addPlugin($acl);
$acl->httpACL($server->httpRequest, $server->httpResponse);
-
}
/**
- * @expectedException Sabre\DAVACL\Exception\AceConflict
+ * @expectedException \Sabre\DAVACL\Exception\AceConflict
*/
- function testUpdateProtectedPrivilege() {
-
+ public function testUpdateProtectedPrivilege()
+ {
$oldACL = [
[
'principal' => 'principals/notfound',
@@ -206,14 +201,13 @@ class ACLMethodTest extends \PHPUnit_Framework_TestCase {
$server->addPlugin($acl);
$acl->httpACL($server->httpRequest, $server->httpResponse);
-
}
/**
- * @expectedException Sabre\DAVACL\Exception\AceConflict
+ * @expectedException \Sabre\DAVACL\Exception\AceConflict
*/
- function testUpdateProtectedPrivilege2() {
-
+ public function testUpdateProtectedPrivilege2()
+ {
$oldACL = [
[
'principal' => 'principals/notfound',
@@ -240,14 +234,13 @@ class ACLMethodTest extends \PHPUnit_Framework_TestCase {
$server->addPlugin($acl);
$acl->httpACL($server->httpRequest, $server->httpResponse);
-
}
/**
- * @expectedException Sabre\DAVACL\Exception\AceConflict
+ * @expectedException \Sabre\DAVACL\Exception\AceConflict
*/
- function testUpdateProtectedPrivilege3() {
-
+ public function testUpdateProtectedPrivilege3()
+ {
$oldACL = [
[
'principal' => 'principals/notfound',
@@ -274,11 +267,10 @@ class ACLMethodTest extends \PHPUnit_Framework_TestCase {
$server->addPlugin($acl);
$acl->httpACL($server->httpRequest, $server->httpResponse);
-
}
- function testSuccessComplex() {
-
+ public function testSuccessComplex()
+ {
$oldACL = [
[
'principal' => 'principals/foo',
@@ -317,7 +309,6 @@ class ACLMethodTest extends \PHPUnit_Framework_TestCase {
$server->addPlugin(new DAV\Auth\Plugin());
$server->addPlugin($acl);
-
$this->assertFalse($acl->httpAcl($server->httpRequest, $server->httpResponse));
$this->assertEquals([
@@ -332,6 +323,5 @@ class ACLMethodTest extends \PHPUnit_Framework_TestCase {
'protected' => false,
],
], $node->getACL());
-
}
}