| 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/a/w/e/awebpaca/Dolibarr/htdocs/includes/sabre/sabre/xml/tests/Sabre/Xml/ |
Upload File : |
<?php
namespace Sabre\Xml;
/**
* Test for the ContextStackTrait
*
* @copyright Copyright (C) 2009-2015 fruux GmbH (https://fruux.com/).
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
class ContextStackTest extends \PHPUnit_Framework_TestCase {
function setUp() {
$this->stack = $this->getMockForTrait('Sabre\\Xml\\ContextStackTrait');
}
function testPushAndPull() {
$this->stack->contextUri = '/foo/bar';
$this->stack->elementMap['{DAV:}foo'] = 'Bar';
$this->stack->namespaceMap['DAV:'] = 'd';
$this->stack->pushContext();
$this->assertEquals('/foo/bar', $this->stack->contextUri);
$this->assertEquals('Bar', $this->stack->elementMap['{DAV:}foo']);
$this->assertEquals('d', $this->stack->namespaceMap['DAV:']);
$this->stack->contextUri = '/gir/zim';
$this->stack->elementMap['{DAV:}foo'] = 'newBar';
$this->stack->namespaceMap['DAV:'] = 'dd';
$this->stack->popContext();
$this->assertEquals('/foo/bar', $this->stack->contextUri);
$this->assertEquals('Bar', $this->stack->elementMap['{DAV:}foo']);
$this->assertEquals('d', $this->stack->namespaceMap['DAV:']);
}
}