Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F1821005
ContextStackTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Size
1 KB
Subscribers
None
ContextStackTest.php
View Options
<?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
Details
Attached
Mime Type
text/x-php
Expires
Mon, Dec 23, 12:55 AM (2 d, 6 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
916799
Default Alt Text
ContextStackTest.php (1 KB)
Attached To
rDAVCAL DokuWiki DAVCal PlugIn
Event Timeline
Log In to Comment