Page MenuHomePhabricator

XmlTest.php
No OneTemporary

XmlTest.php

<?php
namespace Sabre\DAV\Xml;
use Sabre\Xml\Writer;
use Sabre\Xml\Reader;
abstract class XmlTest extends \PHPUnit_Framework_TestCase {
protected $elementMap = [];
protected $namespaceMap = ['DAV:' => 'd'];
protected $contextUri = '/';
function write($input) {
$writer = new Writer();
$writer->contextUri = $this->contextUri;
$writer->namespaceMap = $this->namespaceMap;
$writer->openMemory();
$writer->setIndent(true);
$writer->write($input);
return $writer->outputMemory();
}
function parse($xml, array $elementMap = []) {
$reader = new Reader();
$reader->elementMap = array_merge($this->elementMap, $elementMap);
$reader->xml($xml);
return $reader->parse();
}
function cleanUp() {
libxml_clear_errors();
}
}

File Metadata

Mime Type
text/x-php
Expires
Mon, Dec 23, 12:56 AM (1 d, 17 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
914315
Default Alt Text
XmlTest.php (857 B)

Event Timeline