1<?php
2
3namespace Sabre\CalDAV;
4
5use Sabre\DAVACL;
6
7class CalendarHomeNotificationsTest extends \PHPUnit_Framework_TestCase {
8
9    protected $backend;
10
11    function testGetChildrenNoSupport() {
12
13        $backend = new Backend\Mock();
14        $calendarHome = new CalendarHome($backend,['uri' => 'principals/user']);
15
16        $this->assertEquals(
17            [],
18            $calendarHome->getChildren()
19        );
20
21    }
22
23    /**
24     * @expectedException \Sabre\DAV\Exception\NotFound
25     */
26    function testGetChildNoSupport() {
27
28        $backend = new Backend\Mock();
29        $calendarHome = new CalendarHome($backend,['uri' => 'principals/user']);
30        $calendarHome->getChild('notifications');
31
32    }
33
34    function testGetChildren() {
35
36        $backend = new Backend\MockSharing();
37        $calendarHome = new CalendarHome($backend,['uri' => 'principals/user']);
38
39        $result = $calendarHome->getChildren();
40        $this->assertEquals('notifications', $result[0]->getName());
41
42    }
43
44    function testGetChild() {
45
46        $backend = new Backend\MockSharing();
47        $calendarHome = new CalendarHome($backend,['uri' => 'principals/user']);
48        $result = $calendarHome->getChild('notifications');
49        $this->assertEquals('notifications', $result->getName());
50
51    }
52
53}
54