[Pkg-owncloud-commits] [php-sabredav] 26/33: Better behaving tests
David Prévot
taffit at moszumanska.debian.org
Sat Nov 30 15:43:56 UTC 2013
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to tag version-1.0.10
in repository php-sabredav.
commit 6a8ff6e3dc15ffe055032b2568eabeccbc942216
Author: Evert Pot <evert at rooftopsolutions.nl>
Date: Fri Mar 19 13:41:47 2010 +0900
Better behaving tests
---
tests/Sabre/DAV/AbstractServer.php | 2 +-
tests/Sabre/DAV/ServerPropsTest.php | 3 ++-
tests/bootstrap.php | 4 +++-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/tests/Sabre/DAV/AbstractServer.php b/tests/Sabre/DAV/AbstractServer.php
index 2d2a091..3576d39 100644
--- a/tests/Sabre/DAV/AbstractServer.php
+++ b/tests/Sabre/DAV/AbstractServer.php
@@ -5,7 +5,7 @@ abstract class Sabre_DAV_AbstractServer extends PHPUnit_Framework_TestCase {
protected $response;
protected $request;
protected $server;
- protected $tempDir = 'temp/';
+ protected $tempDir = SABRE_TEMPDIR;
function setUp() {
diff --git a/tests/Sabre/DAV/ServerPropsTest.php b/tests/Sabre/DAV/ServerPropsTest.php
index 6577d05..c146f91 100644
--- a/tests/Sabre/DAV/ServerPropsTest.php
+++ b/tests/Sabre/DAV/ServerPropsTest.php
@@ -18,6 +18,7 @@ class Sabre_DAV_ServerPropsTest extends Sabre_DAV_AbstractServer {
mkdir($this->tempDir . '/col');
file_put_contents($this->tempDir . 'col/test.txt', 'Test contents');
$this->server->addPlugin(new Sabre_DAV_Locks_Plugin());
+ if (file_exists($this->tempDir . '/../.sabredav')) unlink($this->tempDir . '/../.sabredav');
}
@@ -186,7 +187,7 @@ class Sabre_DAV_ServerPropsTest extends Sabre_DAV_AbstractServer {
$data = $xml->xpath('/d:multistatus/d:response/d:propstat/d:status');
$this->assertEquals(1,count($data),'We expected one \'s:status\' element. Response body: ' . $body);
- $this->assertEquals('HTTP/1.1 200 Ok',(string)$data[0]);
+ $this->assertEquals('HTTP/1.1 201 Created',(string)$data[0]);
}
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index 3c9992d..fb48ef3 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -6,5 +6,7 @@ include 'Sabre.autoload.php';
date_default_timezone_set('UTC');
-if (!file_exists('temp')) mkdir('temp');
+define("SABRE_TEMPDIR",dirname(__FILE__) . '/temp/');
+if (!file_exists(SABRE_TEMPDIR)) mkdir(SABRE_TEMPDIR);
+if (file_exists(dirname(__FILE__) . '/.sabredav')) unlink(dirname(__FILE__) . '/.sabredav');
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabredav.git
More information about the Pkg-owncloud-commits
mailing list