Skip to content

Commit 6a8ff6e

Browse files
committed
Better behaving tests
1 parent d95349e commit 6a8ff6e

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

tests/Sabre/DAV/AbstractServer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ abstract class Sabre_DAV_AbstractServer extends PHPUnit_Framework_TestCase {
55
protected $response;
66
protected $request;
77
protected $server;
8-
protected $tempDir = 'temp/';
8+
protected $tempDir = SABRE_TEMPDIR;
99

1010
function setUp() {
1111

tests/Sabre/DAV/ServerPropsTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ function setUp() {
1818
mkdir($this->tempDir . '/col');
1919
file_put_contents($this->tempDir . 'col/test.txt', 'Test contents');
2020
$this->server->addPlugin(new Sabre_DAV_Locks_Plugin());
21+
if (file_exists($this->tempDir . '/../.sabredav')) unlink($this->tempDir . '/../.sabredav');
2122

2223
}
2324

@@ -186,7 +187,7 @@ public function testPropPatch() {
186187
$data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:status');
187188
$this->assertEquals(1,count($data),'We expected one \'s:status\' element. Response body: ' . $body);
188189

189-
$this->assertEquals('HTTP/1.1 200 Ok',(string)$data[0]);
190+
$this->assertEquals('HTTP/1.1 201 Created',(string)$data[0]);
190191

191192
}
192193

tests/bootstrap.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,7 @@
66

77
date_default_timezone_set('UTC');
88

9-
if (!file_exists('temp')) mkdir('temp');
9+
define("SABRE_TEMPDIR",dirname(__FILE__) . '/temp/');
1010

11+
if (!file_exists(SABRE_TEMPDIR)) mkdir(SABRE_TEMPDIR);
12+
if (file_exists(dirname(__FILE__) . '/.sabredav')) unlink(dirname(__FILE__) . '/.sabredav');

0 commit comments

Comments
 (0)