Page MenuHomePhabricator

ContextStackTest.php
No OneTemporary

ContextStackTest.php

<?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:']);
}
}

File Metadata

Mime Type
text/x-php
Expires
Mon, Dec 23, 12:55 AM (1 d, 18 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
916799
Default Alt Text
ContextStackTest.php (1 KB)

Event Timeline