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