1<?php
2
3namespace Sabre\DAVACL\FS;
4
5class FileTest extends \PHPUnit_Framework_TestCase {
6
7    /**
8     * System under test
9     *
10     * @var File
11     */
12    protected $sut;
13
14    protected $path = 'foo';
15    protected $acl = [
16        [
17            'privilege' => '{DAV:}read',
18            'principal' => '{DAV:}authenticated',
19        ]
20    ];
21
22    protected $owner = 'principals/evert';
23
24    function setUp() {
25
26        $this->sut = new File($this->path, $this->acl, $this->owner);
27
28    }
29
30    function testGetOwner() {
31
32        $this->assertEquals(
33            $this->owner,
34            $this->sut->getOwner()
35        );
36
37    }
38
39    function testGetGroup() {
40
41        $this->assertNull(
42            $this->sut->getGroup()
43        );
44
45    }
46
47    function testGetACL() {
48
49        $this->assertEquals(
50            $this->acl,
51            $this->sut->getACL()
52        );
53
54    }
55
56    /**
57     * @expectedException \Sabre\DAV\Exception\Forbidden
58     */
59    function testSetAcl() {
60
61        $this->sut->setACL([]);
62
63    }
64
65    function testGetSupportedPrivilegeSet() {
66
67        $this->assertNull(
68            $this->sut->getSupportedPrivilegeSet()
69        );
70
71    }
72
73}
74