2013-10-21 22:46:31 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Sabre\CardDAV;
|
|
|
|
|
|
|
|
use Sabre\DAV;
|
|
|
|
|
|
|
|
class IDirectoryTest extends \PHPUnit_Framework_TestCase {
|
|
|
|
|
|
|
|
function testResourceType() {
|
|
|
|
|
2016-05-28 15:46:24 +00:00
|
|
|
$tree = [
|
2013-10-21 22:46:31 +00:00
|
|
|
new DirectoryMock('directory')
|
2016-05-28 15:46:24 +00:00
|
|
|
];
|
2013-10-21 22:46:31 +00:00
|
|
|
|
|
|
|
$server = new DAV\Server($tree);
|
|
|
|
$plugin = new Plugin();
|
|
|
|
$server->addPlugin($plugin);
|
|
|
|
|
2016-05-28 15:46:24 +00:00
|
|
|
$props = $server->getProperties('directory', ['{DAV:}resourcetype']);
|
2013-10-21 22:46:31 +00:00
|
|
|
$this->assertTrue($props['{DAV:}resourcetype']->is('{' . Plugin::NS_CARDDAV . '}directory'));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
class DirectoryMock extends DAV\SimpleCollection implements IDirectory {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|