Page MenuHomePhabricator

PluginTest.php
No OneTemporary

PluginTest.php

<?php
namespace Sabre\CalDAV\Subscriptions;
use Sabre\DAV\PropFind;
class PluginTest extends \PHPUnit_Framework_TestCase {
function testInit() {
$server = new \Sabre\DAV\Server();
$plugin = new Plugin();
$server->addPlugin($plugin);
$this->assertEquals(
'{http://calendarserver.org/ns/}subscribed',
$server->resourceTypeMapping['Sabre\\CalDAV\\Subscriptions\\ISubscription']
);
$this->assertEquals(
'Sabre\\DAV\\Xml\\Property\\Href',
$server->xml->elementMap['{http://calendarserver.org/ns/}source']
);
$this->assertEquals(
['calendarserver-subscribed'],
$plugin->getFeatures()
);
$this->assertEquals(
'subscriptions',
$plugin->getPluginInfo()['name']
);
}
function testPropFind() {
$propName = '{http://calendarserver.org/ns/}subscribed-strip-alarms';
$propFind = new PropFind('foo', [$propName]);
$propFind->set($propName,null,200);
$plugin = new Plugin();
$plugin->propFind($propFind, new \Sabre\DAV\SimpleCollection('hi'));
$this->assertFalse(is_null($propFind->get($propName)));
}
}

File Metadata

Mime Type
text/x-php
Expires
Wed, Jan 8, 6:49 AM (2 d, 10 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
914200
Default Alt Text
PluginTest.php (1 KB)

Event Timeline