Skip to content

Commit

Permalink
Merge pull request #45 from mekras/fix-mkcol
Browse files Browse the repository at this point in the history
Collections should be created with a slash at the end.
  • Loading branch information
frankdejonge authored Dec 14, 2018
2 parents b778244 + 793f9a3 commit 34783da
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
stopOnFailure="true"
syntaxCheck="true"
>
<php>
<ini name="memory_limit" value="128M" />
</php>

<testsuites>
<testsuite name="flysystem/gridfs/tests">
<directory suffix=".php">./tests/</directory>
Expand Down
2 changes: 1 addition & 1 deletion src/WebDAVAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public function createDir($path, Config $config)
}

$location = $this->applyPathPrefix($encodedPath);
$response = $this->client->request('MKCOL', $location);
$response = $this->client->request('MKCOL', $location . $this->pathSeparator);

if ($response['statusCode'] !== 201) {
return false;
Expand Down
8 changes: 4 additions & 4 deletions tests/WebDAVTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public function testCreateDir()

$mock->shouldReceive('request')
->once()
->with('MKCOL', 'dirname')
->with('MKCOL', 'dirname/')
->andReturn([
'statusCode' => 201,
]);
Expand All @@ -309,14 +309,14 @@ public function testCreateDirRecursive()

$mock->shouldReceive('request')
->once()
->with('MKCOL', 'dirname')
->with('MKCOL', 'dirname/')
->andReturn([
'statusCode' => 201,
]);

$mock->shouldReceive('request')
->once()
->with('MKCOL', 'dirname/subdirname')
->with('MKCOL', 'dirname/subdirname/')
->andReturn([
'statusCode' => 201,
]);
Expand Down Expand Up @@ -359,7 +359,7 @@ public function testCreateDirFail()

$mock->shouldReceive('request')
->once()
->with('MKCOL', 'dirname')
->with('MKCOL', 'dirname/')
->andReturn([
'statusCode' => 500,
]);
Expand Down

0 comments on commit 34783da

Please sign in to comment.