AnonSec Shell
Server IP : 213.186.33.4  /  Your IP : 216.73.216.193
Web Server : Apache
System : Linux webm006.cluster103.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User : awebpaca ( 35430)
PHP Version : 8.5.0
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/awebpaca/Dolibarr/htdocs/includes/sabre/sabre/dav/tests/Sabre/CalDAV/Schedule/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/awebpaca/Dolibarr/htdocs/includes/sabre/sabre/dav/tests/Sabre/CalDAV/Schedule//InboxTest.php
<?php

namespace Sabre\CalDAV\Schedule;

use Sabre\CalDAV;
use Sabre\DAV;

class InboxTest extends \PHPUnit_Framework_TestCase {

    function testSetup() {

        $inbox = new Inbox(
            new CalDAV\Backend\MockScheduling(),
            'principals/user1'
        );
        $this->assertEquals('inbox', $inbox->getName());
        $this->assertEquals([], $inbox->getChildren());
        $this->assertEquals('principals/user1', $inbox->getOwner());
        $this->assertEquals(null, $inbox->getGroup());

        $this->assertEquals([
            [
                'privilege' => '{DAV:}read',
                'principal' => '{DAV:}authenticated',
                'protected' => true,
            ],
            [
                'privilege' => '{DAV:}write-properties',
                'principal' => 'principals/user1',
                'protected' => true,
            ],
            [
                'privilege' => '{DAV:}unbind',
                'principal' => 'principals/user1',
                'protected' => true,
            ],
            [
                'privilege' => '{DAV:}unbind',
                'principal' => 'principals/user1/calendar-proxy-write',
                'protected' => true,
            ],
            [
                'privilege' => '{urn:ietf:params:xml:ns:caldav}schedule-deliver',
                'principal' => '{DAV:}authenticated',
                'protected' => true,
            ],
        ], $inbox->getACL());

        $ok = false;

    }

    /**
     * @depends testSetup
     */
    function testGetChildren() {

        $backend = new CalDAV\Backend\MockScheduling();
        $inbox = new Inbox(
            $backend,
            'principals/user1'
        );

        $this->assertEquals(
            0,
            count($inbox->getChildren())
        );
        $backend->createSchedulingObject('principals/user1', 'schedule1.ics', "BEGIN:VCALENDAR\r\nEND:VCALENDAR");
        $this->assertEquals(
            1,
            count($inbox->getChildren())
        );
        $this->assertInstanceOf('Sabre\CalDAV\Schedule\SchedulingObject', $inbox->getChildren()[0]);
        $this->assertEquals(
            'schedule1.ics',
            $inbox->getChildren()[0]->getName()
        );

    }

    /**
     * @depends testGetChildren
     */
    function testCreateFile() {

        $backend = new CalDAV\Backend\MockScheduling();
        $inbox = new Inbox(
            $backend,
            'principals/user1'
        );

        $this->assertEquals(
            0,
            count($inbox->getChildren())
        );
        $inbox->createFile('schedule1.ics', "BEGIN:VCALENDAR\r\nEND:VCALENDAR");
        $this->assertEquals(
            1,
            count($inbox->getChildren())
        );
        $this->assertInstanceOf('Sabre\CalDAV\Schedule\SchedulingObject', $inbox->getChildren()[0]);
        $this->assertEquals(
            'schedule1.ics',
            $inbox->getChildren()[0]->getName()
        );

    }

    /**
     * @depends testSetup
     */
    function testCalendarQuery() {

        $backend = new CalDAV\Backend\MockScheduling();
        $inbox = new Inbox(
            $backend,
            'principals/user1'
        );

        $this->assertEquals(
            0,
            count($inbox->getChildren())
        );
        $backend->createSchedulingObject('principals/user1', 'schedule1.ics', "BEGIN:VCALENDAR\r\nEND:VCALENDAR");
        $this->assertEquals(
            ['schedule1.ics'],
            $inbox->calendarQuery([
                'name'           => 'VCALENDAR',
                'comp-filters'   => [],
                'prop-filters'   => [],
                'is-not-defined' => false
            ])
        );

    }
}

Anon7 - 2022
AnonSec Team