25 'file1' =>
'content1',
26 'file2' =>
'content2',
33 $request =
new HTTP\Request(
'MOVE',
'/file1', [
34 'Destination' =>
'/file1'
37 $this->assertEquals(403,
$response->getStatus());
38 $this->assertEquals(
'content1', $this->tree->getChild(
'file1')->get());
44 $request =
new HTTP\Request(
'MOVE',
'/file1', [
45 'Destination' =>
'/file3'
49 $this->assertEquals(
'content1', $this->tree->getChild(
'file3')->get());
50 $this->assertFalse($this->tree->childExists(
'file1'));
56 $request =
new HTTP\Request(
'MOVE',
'/file1', [
57 'Destination' =>
'/file2'
61 $this->assertEquals(
'content1', $this->tree->getChild(
'file2')->get());
62 $this->assertFalse($this->tree->childExists(
'file1'));
68 $request =
new HTTP\Request(
'MOVE',
'/file1', [
69 'Destination' =>
'/file2',
74 $this->assertEquals(
'content1', $this->tree->getChild(
'file2')->get());
75 $this->assertFalse($this->tree->childExists(
'file1'));
81 $request =
new HTTP\Request(
'MOVE',
'/file1', [
82 'Destination' =>
'/file2',
87 $this->assertEquals(
'content1', $this->tree->getChild(
'file1')->get());
88 $this->assertEquals(
'content2', $this->tree->getChild(
'file2')->get());
89 $this->assertTrue($this->tree->childExists(
'file1'));
90 $this->assertTrue($this->tree->childExists(
'file2'));
101 $this->server->on(
'beforeUnbind',
function(
$path) {
103 if (
$path ===
'file1') {
104 throw new \Sabre\DAV\Exception\Forbidden(
'uh oh');
108 $request =
new HTTP\Request(
'MOVE',
'/file1', [
109 'Destination' =>
'/file2'
113 $this->assertEquals(
'content1', $this->tree->getChild(
'file1')->get());
114 $this->assertEquals(
'content2', $this->tree->getChild(
'file2')->get());
115 $this->assertTrue($this->tree->childExists(
'file1'));
116 $this->assertTrue($this->tree->childExists(
'file2'));
foreach($paths as $path) $request
An exception for terminatinating execution or to throw for unit testing.
This class may be used as a basis for other webdav-related unittests.
request($request, $expectedStatus=null)
Makes a request, and returns a response object.
Tests related to the MOVE request.
testMoveToExistingOverwriteF()
testMoveToExistingOverwriteT()
setUpTree()
Sets up the DAV tree.
testMoveToExistingBlockedDeleteSource()
If we MOVE to an existing file, but a plugin prevents the original from being deleted,...