diff options
author | Andrew Manning <tamanning@zoho.com> | 2016-05-11 05:54:20 -0400 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2016-05-11 05:54:20 -0400 |
commit | d968fc51eab8b0fb259ecbeae517056b99554017 (patch) | |
tree | 10e551cff9fefbefbfd7e5031b57320116bb7fce /vendor/sabre/dav/tests/Sabre/CalDAV/Notifications/Notification/InviteReplyTest.php | |
parent | c7698e4dc388b7d9a9db368672cb057c1d4d3a01 (diff) | |
parent | 4dd3839c41e18d9724855e7955d8737b6f52dcd6 (diff) | |
download | volse-hubzilla-d968fc51eab8b0fb259ecbeae517056b99554017.tar.gz volse-hubzilla-d968fc51eab8b0fb259ecbeae517056b99554017.tar.bz2 volse-hubzilla-d968fc51eab8b0fb259ecbeae517056b99554017.zip |
Merge remote-tracking branch 'upstream/dev' into plugin-repo
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/CalDAV/Notifications/Notification/InviteReplyTest.php')
-rw-r--r-- | vendor/sabre/dav/tests/Sabre/CalDAV/Notifications/Notification/InviteReplyTest.php | 134 |
1 files changed, 0 insertions, 134 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/CalDAV/Notifications/Notification/InviteReplyTest.php b/vendor/sabre/dav/tests/Sabre/CalDAV/Notifications/Notification/InviteReplyTest.php deleted file mode 100644 index c53f68cee..000000000 --- a/vendor/sabre/dav/tests/Sabre/CalDAV/Notifications/Notification/InviteReplyTest.php +++ /dev/null @@ -1,134 +0,0 @@ -<?php - -namespace Sabre\CalDAV\Notifications\Notification; - -use Sabre\CalDAV; -use Sabre\DAV; - -class InviteReplyTest extends \PHPUnit_Framework_TestCase { - - /** - * @dataProvider dataProvider - */ - function testSerializers($notification, $expected) { - - $notification = new InviteReply($notification); - - $this->assertEquals('foo', $notification->getId()); - $this->assertEquals('"1"', $notification->getETag()); - - $simpleExpected = '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . '<cs:root xmlns:cs="http://calendarserver.org/ns/"><cs:invite-reply/></cs:root>' . "\n"; - - $dom = new \DOMDocument('1.0','UTF-8'); - $elem = $dom->createElement('cs:root'); - $elem->setAttribute('xmlns:cs',CalDAV\Plugin::NS_CALENDARSERVER); - $dom->appendChild($elem); - $notification->serialize(new DAV\Server(), $elem); - $this->assertEquals($simpleExpected, $dom->saveXML()); - - $dom = new \DOMDocument('1.0','UTF-8'); - $dom->formatOutput = true; - $elem = $dom->createElement('cs:root'); - $elem->setAttribute('xmlns:cs',CalDAV\Plugin::NS_CALENDARSERVER); - $elem->setAttribute('xmlns:d','DAV:'); - $dom->appendChild($elem); - $notification->serializeBody(new DAV\Server(), $elem); - $this->assertEquals($expected, $dom->saveXML()); - - - } - - function dataProvider() { - - $dtStamp = new \DateTime('2012-01-01 00:00:00 GMT'); - return array( - array( - array( - 'id' => 'foo', - 'dtStamp' => $dtStamp, - 'etag' => '"1"', - 'inReplyTo' => 'bar', - 'href' => 'mailto:foo@example.org', - 'type' => CalDAV\SharingPlugin::STATUS_ACCEPTED, - 'hostUrl' => 'calendar' - ), -<<<FOO -<?xml version="1.0" encoding="UTF-8"?> -<cs:root xmlns:cs="http://calendarserver.org/ns/" xmlns:d="DAV:"> - <cs:dtstamp>20120101T000000Z</cs:dtstamp> - <cs:invite-reply> - <cs:uid>foo</cs:uid> - <cs:in-reply-to>bar</cs:in-reply-to> - <d:href>mailto:foo@example.org</d:href> - <cs:invite-accepted/> - <cs:hosturl> - <d:href>/calendar</d:href> - </cs:hosturl> - </cs:invite-reply> -</cs:root> - -FOO - ), - array( - array( - 'id' => 'foo', - 'dtStamp' => $dtStamp, - 'etag' => '"1"', - 'inReplyTo' => 'bar', - 'href' => 'mailto:foo@example.org', - 'type' => CalDAV\SharingPlugin::STATUS_DECLINED, - 'hostUrl' => 'calendar', - 'summary' => 'Summary!' - ), -<<<FOO -<?xml version="1.0" encoding="UTF-8"?> -<cs:root xmlns:cs="http://calendarserver.org/ns/" xmlns:d="DAV:"> - <cs:dtstamp>20120101T000000Z</cs:dtstamp> - <cs:invite-reply> - <cs:uid>foo</cs:uid> - <cs:in-reply-to>bar</cs:in-reply-to> - <d:href>mailto:foo@example.org</d:href> - <cs:invite-declined/> - <cs:hosturl> - <d:href>/calendar</d:href> - </cs:hosturl> - <cs:summary>Summary!</cs:summary> - </cs:invite-reply> -</cs:root> - -FOO - ), - - ); - - } - - /** - * @expectedException InvalidArgumentException - */ - function testMissingArg() { - - new InviteReply(array()); - - } - - /** - * @expectedException InvalidArgumentException - */ - function testUnknownArg() { - - new InviteReply(array( - 'foo-i-will-break' => true, - - 'id' => 1, - 'etag' => '"bla"', - 'href' => 'abc', - 'dtStamp' => 'def', - 'inReplyTo' => 'qrs', - 'type' => 'ghi', - 'hostUrl' => 'jkl', - )); - - } - -} |