diff options
author | Mario <mario@mariovavti.com> | 2019-12-04 10:25:11 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2019-12-04 10:25:11 +0000 |
commit | bde429cff649237984903a252ba1a718e6d74f53 (patch) | |
tree | b2b2570159cfb37689e6ce3b96c3b1b988d676cc /vendor/sabre/dav/tests/Sabre/DAV/Issue33Test.php | |
parent | cc9f41df5f83bcab435d6fb941b5a8f5b1457037 (diff) | |
parent | 4c8d33d1eb2a804aa70a7bc677d6c73d0d94816b (diff) | |
download | volse-hubzilla-4.6.tar.gz volse-hubzilla-4.6.tar.bz2 volse-hubzilla-4.6.zip |
Merge branch '4.6RC'4.6
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/DAV/Issue33Test.php')
-rw-r--r-- | vendor/sabre/dav/tests/Sabre/DAV/Issue33Test.php | 65 |
1 files changed, 27 insertions, 38 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/Issue33Test.php b/vendor/sabre/dav/tests/Sabre/DAV/Issue33Test.php index ba2cf3dc1..500ad6147 100644 --- a/vendor/sabre/dav/tests/Sabre/DAV/Issue33Test.php +++ b/vendor/sabre/dav/tests/Sabre/DAV/Issue33Test.php @@ -1,34 +1,32 @@ <?php +declare(strict_types=1); + namespace Sabre\DAV; use Sabre\HTTP; require_once 'Sabre/TestUtil.php'; -class Issue33Test extends \PHPUnit_Framework_TestCase { - - function setUp() { - +class Issue33Test extends \PHPUnit\Framework\TestCase +{ + public function setUp() + { \Sabre\TestUtil::clearTempDir(); - } - function testCopyMoveInfo() { - + public function testCopyMoveInfo() + { $bar = new SimpleCollection('bar'); $root = new SimpleCollection('webdav', [$bar]); $server = new Server($root); $server->setBaseUri('/webdav/'); - $serverVars = [ - 'REQUEST_URI' => '/webdav/bar', - 'HTTP_DESTINATION' => 'http://dev2.tribalos.com/webdav/%C3%A0fo%C3%B3', - 'HTTP_OVERWRITE' => 'F', - ]; - - $request = HTTP\Sapi::createFromServerArray($serverVars); + $request = new HTTP\Request('GET', '/webdav/bar', [ + 'Destination' => 'http://dev2.tribalos.com/webdav/%C3%A0fo%C3%B3', + 'Overwrite' => 'F', + ]); $server->httpRequest = $request; @@ -37,13 +35,12 @@ class Issue33Test extends \PHPUnit_Framework_TestCase { $this->assertEquals('%C3%A0fo%C3%B3', urlencode($info['destination'])); $this->assertFalse($info['destinationExists']); $this->assertFalse($info['destinationNode']); - } - function testTreeMove() { - - mkdir(SABRE_TEMPDIR . '/issue33'); - $dir = new FS\Directory(SABRE_TEMPDIR . '/issue33'); + public function testTreeMove() + { + mkdir(SABRE_TEMPDIR.'/issue33'); + $dir = new FS\Directory(SABRE_TEMPDIR.'/issue33'); $dir->createDirectory('bar'); @@ -52,40 +49,34 @@ class Issue33Test extends \PHPUnit_Framework_TestCase { $node = $tree->getNodeForPath(urldecode('%C3%A0fo%C3%B3')); $this->assertEquals(urldecode('%C3%A0fo%C3%B3'), $node->getName()); - } - function testDirName() { - + public function testDirName() + { $dirname1 = 'bar'; $dirname2 = urlencode('%C3%A0fo%C3%B3'); $this->assertTrue(dirname($dirname1) == dirname($dirname2)); - } /** * @depends testTreeMove * @depends testCopyMoveInfo */ - function testEverything() { + public function testEverything() + { + $request = new HTTP\Request('MOVE', '/webdav/bar', [ + 'Destination' => 'http://dev2.tribalos.com/webdav/%C3%A0fo%C3%B3', + 'Overwrite' => 'F', + ]); - // Request object - $serverVars = [ - 'REQUEST_METHOD' => 'MOVE', - 'REQUEST_URI' => '/webdav/bar', - 'HTTP_DESTINATION' => 'http://dev2.tribalos.com/webdav/%C3%A0fo%C3%B3', - 'HTTP_OVERWRITE' => 'F', - ]; - - $request = HTTP\Sapi::createFromServerArray($serverVars); $request->setBody(''); $response = new HTTP\ResponseMock(); // Server setup - mkdir(SABRE_TEMPDIR . '/issue33'); - $dir = new FS\Directory(SABRE_TEMPDIR . '/issue33'); + mkdir(SABRE_TEMPDIR.'/issue33'); + $dir = new FS\Directory(SABRE_TEMPDIR.'/issue33'); $dir->createDirectory('bar'); @@ -99,8 +90,6 @@ class Issue33Test extends \PHPUnit_Framework_TestCase { $server->sapi = new HTTP\SapiMock(); $server->exec(); - $this->assertTrue(file_exists(SABRE_TEMPDIR . '/issue33/' . urldecode('%C3%A0fo%C3%B3'))); - + $this->assertTrue(file_exists(SABRE_TEMPDIR.'/issue33/'.urldecode('%C3%A0fo%C3%B3'))); } - } |