[Pkg-owncloud-commits] [php-sabredav] 132/148: Fixed a bunch of unittests.
David Prévot
taffit at moszumanska.debian.org
Wed Apr 15 01:37:32 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository php-sabredav.
commit 3bff28ec704c4644ab2ae443db518acd7960a257
Author: Evert Pot <me at evertpot.com>
Date: Sun Apr 12 23:40:13 2015 -0400
Fixed a bunch of unittests.
---
tests/Sabre/CalDAV/PluginTest.php | 24 ------------
tests/Sabre/CardDAV/PluginTest.php | 23 -----------
tests/Sabre/DAV/ServerMKCOLTest.php | 44 +++-------------------
.../DAVACL/PrincipalBackend/AbstractPDOTest.php | 4 --
.../DAVACL/PrincipalBackend/PDOSqliteTest.php | 6 +--
5 files changed, 9 insertions(+), 92 deletions(-)
diff --git a/tests/Sabre/CalDAV/PluginTest.php b/tests/Sabre/CalDAV/PluginTest.php
index aff3113..9b1a922 100644
--- a/tests/Sabre/CalDAV/PluginTest.php
+++ b/tests/Sabre/CalDAV/PluginTest.php
@@ -930,30 +930,6 @@ XML;
}
- function testBrowserPostAction() {
-
- $r = $this->server->emit('onBrowserPostAction', ['calendars/user1', 'mkcalendar', [
- 'name' => 'NEWCALENDAR',
- '{DAV:}displayname' => 'foo',
- ]]);
- $this->assertFalse($r);
-
- $calendars = $this->caldavBackend->getCalendarsForUser('principals/user1');
- $this->assertEquals(3, count($calendars));
-
- $newCalendar = null;
- foreach($calendars as $calendar) {
- if ($calendar['uri'] === 'NEWCALENDAR') {
- $newCalendar = $calendar;
- break;
- }
- }
- if (!$newCalendar)
- $this->fail('Could not find newly created calendar');
-
-
- }
-
/**
* @depends testCalendarMultiGetReport
*/
diff --git a/tests/Sabre/CardDAV/PluginTest.php b/tests/Sabre/CardDAV/PluginTest.php
index a053e48..b8fc71d 100644
--- a/tests/Sabre/CardDAV/PluginTest.php
+++ b/tests/Sabre/CardDAV/PluginTest.php
@@ -68,29 +68,6 @@ class PluginTest extends AbstractPluginTest {
}
- function testBrowserPostAction() {
-
- $r = $this->server->emit('onBrowserPostAction', ['addressbooks/user1', 'mkaddressbook', [
- 'name' => 'NEWADDRESSBOOK',
- '{DAV:}displayname' => 'foo',
- ]]);
- $this->assertFalse($r);
-
- $addressbooks = $this->backend->getAddressBooksforUser('principals/user1');
- $this->assertEquals(2, count($addressbooks));
-
- $newAddressBook = null;
- foreach($addressbooks as $addressbook) {
- if ($addressbook['uri'] === 'NEWADDRESSBOOK') {
- $newAddressBook = $addressbook;
- break;
- }
- }
- if (!$newAddressBook)
- $this->fail('Could not find newly created addressbook');
-
- }
-
function testAddressbookPluginProperties() {
$ns = '{' . Plugin::NS_CARDDAV . '}';
diff --git a/tests/Sabre/DAV/ServerMKCOLTest.php b/tests/Sabre/DAV/ServerMKCOLTest.php
index 39e577c..e35189e 100644
--- a/tests/Sabre/DAV/ServerMKCOLTest.php
+++ b/tests/Sabre/DAV/ServerMKCOLTest.php
@@ -136,7 +136,7 @@ class ServerMKCOLTest extends AbstractServer {
}
/**
- * @depends testMKCOLNoResourceType
+ * @depends testMkcol
*/
function testMKCOLIncorrectResourceType() {
@@ -151,38 +151,6 @@ class ServerMKCOLTest extends AbstractServer {
<mkcol xmlns="DAV:">
<set>
<prop>
- <resourcetype><blabla /></resourcetype>
- </prop>
- </set>
-</mkcol>');
- $this->server->httpRequest = ($request);
- $this->server->exec();
-
- $this->assertEquals(array(
- 'X-Sabre-Version' => [Version::VERSION],
- 'Content-Type' => ['application/xml; charset=utf-8'],
- ),$this->response->getHeaders());
-
- $this->assertEquals(403, $this->response->status, 'Wrong statuscode received. Full response body: ' .$this->response->body);
-
- }
-
- /**
- * @depends testMKCOLIncorrectResourceType
- */
- function testMKCOLIncorrectResourceType2() {
-
- $serverVars = array(
- 'REQUEST_URI' => '/testcol',
- 'REQUEST_METHOD' => 'MKCOL',
- 'HTTP_CONTENT_TYPE' => 'application/xml',
- );
-
- $request = HTTP\Sapi::createFromServerArray($serverVars);
- $request->setBody('<?xml version="1.0"?>
-<mkcol xmlns="DAV:">
- <set>
- <prop>
<resourcetype><collection /><blabla /></resourcetype>
</prop>
</set>
@@ -200,7 +168,7 @@ class ServerMKCOLTest extends AbstractServer {
}
/**
- * @depends testMKCOLIncorrectResourceType2
+ * @depends testMKCOLIncorrectResourceType
*/
function testMKCOLSuccess() {
@@ -232,7 +200,7 @@ class ServerMKCOLTest extends AbstractServer {
}
/**
- * @depends testMKCOLIncorrectResourceType2
+ * @depends testMKCOLIncorrectResourceType
*/
function testMKCOLWhiteSpaceResourceType() {
@@ -266,7 +234,7 @@ class ServerMKCOLTest extends AbstractServer {
}
/**
- * @depends testMKCOLIncorrectResourceType2
+ * @depends testMKCOLIncorrectResourceType
*/
function testMKCOLNoParent() {
@@ -291,7 +259,7 @@ class ServerMKCOLTest extends AbstractServer {
}
/**
- * @depends testMKCOLIncorrectResourceType2
+ * @depends testMKCOLIncorrectResourceType
*/
function testMKCOLParentIsNoCollection() {
@@ -316,7 +284,7 @@ class ServerMKCOLTest extends AbstractServer {
}
/**
- * @depends testMKCOLIncorrectResourceType2
+ * @depends testMKCOLIncorrectResourceType
*/
function testMKCOLAlreadyExists() {
diff --git a/tests/Sabre/DAVACL/PrincipalBackend/AbstractPDOTest.php b/tests/Sabre/DAVACL/PrincipalBackend/AbstractPDOTest.php
index ea6bf2a..5aab1b7 100644
--- a/tests/Sabre/DAVACL/PrincipalBackend/AbstractPDOTest.php
+++ b/tests/Sabre/DAVACL/PrincipalBackend/AbstractPDOTest.php
@@ -130,7 +130,6 @@ abstract class AbstractPDOTest extends \PHPUnit_Framework_TestCase {
$propPatch = new DAV\PropPatch([
'{DAV:}displayname' => 'pietje',
- '{http://sabredav.org/ns}vcard-url' => 'blabla',
]);
$backend->updatePrincipal('principals/user', $propPatch);
@@ -142,7 +141,6 @@ abstract class AbstractPDOTest extends \PHPUnit_Framework_TestCase {
'id' => 1,
'uri' => 'principals/user',
'{DAV:}displayname' => 'pietje',
- '{http://sabredav.org/ns}vcard-url' => 'blabla',
'{http://sabredav.org/ns}email-address' => 'user at example.org',
), $backend->getPrincipalByPath('principals/user'));
@@ -155,7 +153,6 @@ abstract class AbstractPDOTest extends \PHPUnit_Framework_TestCase {
$propPatch = new DAV\PropPatch([
'{DAV:}displayname' => 'pietje',
- '{http://sabredav.org/ns}vcard-url' => 'blabla',
'{DAV:}unknown' => 'foo',
]);
@@ -166,7 +163,6 @@ abstract class AbstractPDOTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals(array(
'{DAV:}displayname' => 424,
- '{http://sabredav.org/ns}vcard-url' => 424,
'{DAV:}unknown' => 403
), $propPatch->getResult());
diff --git a/tests/Sabre/DAVACL/PrincipalBackend/PDOSqliteTest.php b/tests/Sabre/DAVACL/PrincipalBackend/PDOSqliteTest.php
index 192e188..d3a3575 100644
--- a/tests/Sabre/DAVACL/PrincipalBackend/PDOSqliteTest.php
+++ b/tests/Sabre/DAVACL/PrincipalBackend/PDOSqliteTest.php
@@ -22,9 +22,9 @@ class PDOSQLiteTest extends AbstractPDOTest {
if (!SABRE_HASSQLITE) $this->markTestSkipped('SQLite driver is not available');
$pdo = new \PDO('sqlite:'.SABRE_TEMPDIR.'/pdobackend');
$pdo->setAttribute(\PDO::ATTR_ERRMODE,\PDO::ERRMODE_EXCEPTION);
- $pdo->query('CREATE TABLE principals (id INTEGER PRIMARY KEY ASC, uri TEXT, email VARCHAR(80), displayname VARCHAR(80), vcardurl VARCHAR(80))');
- $pdo->query('INSERT INTO principals VALUES (1, "principals/user","user at example.org","User",null)');
- $pdo->query('INSERT INTO principals VALUES (2, "principals/group","group at example.org","Group",null)');
+ $pdo->query('CREATE TABLE principals (id INTEGER PRIMARY KEY ASC, uri TEXT, email VARCHAR(80), displayname VARCHAR(80))');
+ $pdo->query('INSERT INTO principals VALUES (1, "principals/user","user at example.org","User")');
+ $pdo->query('INSERT INTO principals VALUES (2, "principals/group","group at example.org","Group")');
$pdo->query("CREATE TABLE groupmembers (
id INTEGER PRIMARY KEY ASC,
--
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