3 class Sabre_DAVACL_AllowAccessTest extends PHPUnit_Framework_TestCase {
6 * @var Sabre_DAV_Server
13 new Sabre_DAV_SimpleCollection('testdir'),
16 $this->server = new Sabre_DAV_Server($nodes);
17 $aclPlugin = new Sabre_DAVACL_Plugin();
18 $aclPlugin->allowAccessToNodesWithoutACL = true;
19 $this->server->addPlugin($aclPlugin);
25 $this->assertTrue($this->server->broadcastEvent('beforeMethod',array('GET','testdir')));
29 function testGetDoesntExist() {
31 $r = $this->server->broadcastEvent('beforeMethod',array('GET','foo'));
32 $this->assertTrue($r);
38 $this->assertTrue($this->server->broadcastEvent('beforeMethod',array('HEAD','testdir')));
42 function testOPTIONS() {
44 $this->assertTrue($this->server->broadcastEvent('beforeMethod',array('OPTIONS','testdir')));
50 $this->assertTrue($this->server->broadcastEvent('beforeMethod',array('PUT','testdir')));
56 $this->assertTrue($this->server->broadcastEvent('beforeMethod',array('ACL','testdir')));
60 function testPROPPATCH() {
62 $this->assertTrue($this->server->broadcastEvent('beforeMethod',array('PROPPATCH','testdir')));
68 $this->assertTrue($this->server->broadcastEvent('beforeMethod',array('COPY','testdir')));
74 $this->assertTrue($this->server->broadcastEvent('beforeMethod',array('MOVE','testdir')));
80 $this->assertTrue($this->server->broadcastEvent('beforeMethod',array('LOCK','testdir')));
84 function testBeforeBind() {
86 $this->assertTrue($this->server->broadcastEvent('beforeBind',array('testdir/file')));
91 function testBeforeUnbind() {
93 $this->assertTrue($this->server->broadcastEvent('beforeUnbind',array('testdir')));
97 function testAfterGetProperties() {
102 '{DAV:}displayname' => 'foo',
103 '{DAV:}getcontentlength' => 500,
109 '{DAV:}owner' => null,
116 '{DAV:}displayname' => 'foo',
117 '{DAV:}getcontentlength' => 500,
123 '{DAV:}owner' => null,
127 $r = $this->server->broadcastEvent('afterGetProperties',array('testdir',&$properties));
128 $this->assertTrue($r);
130 $this->assertEquals($expected, $properties);