Lggr
Static Public Member Functions | List of all members
PHPUnit\Util\Xml Class Reference

Static Public Member Functions

static load ($actual, $isHtml=false, $filename='', $xinclude=false, $strict=false)
 
static loadFile ($filename, $isHtml=false, $xinclude=false, $strict=false)
 
static removeCharacterDataNodes (DOMNode $node)
 
static prepareString ($string)
 
static xmlToVariable (DOMElement $element)
 

Detailed Description

XML helpers.

Member Function Documentation

◆ load()

static PHPUnit\Util\Xml::load (   $actual,
  $isHtml = false,
  $filename = '',
  $xinclude = false,
  $strict = false 
)
static

Load an $actual document into a DOMDocument. This is called from the selector assertions.

If $actual is already a DOMDocument, it is returned with no changes. Otherwise, $actual is loaded into a new DOMDocument as either HTML or XML, depending on the value of $isHtml. If $isHtml is false and $xinclude is true, xinclude is performed on the loaded DOMDocument.

Note: prior to PHPUnit 3.3.0, this method loaded a file and not a string as it currently does. To load a file into a DOMDocument, use loadFile() instead.

Parameters
string | DOMDocument$actual
bool$isHtml
string$filename
bool$xinclude
bool$strict
Returns
DOMDocument

◆ loadFile()

static PHPUnit\Util\Xml::loadFile (   $filename,
  $isHtml = false,
  $xinclude = false,
  $strict = false 
)
static

Loads an XML (or HTML) file into a DOMDocument object.

Parameters
string$filename
bool$isHtml
bool$xinclude
bool$strict
Returns
DOMDocument

◆ prepareString()

static PHPUnit\Util\Xml::prepareString (   $string)
static

Escapes a string for the use in XML documents Any Unicode character is allowed, excluding the surrogate blocks, FFFE, and FFFF (not even as character reference). See http://www.w3.org/TR/xml/#charsets

Parameters
string$string
Returns
string

◆ removeCharacterDataNodes()

static PHPUnit\Util\Xml::removeCharacterDataNodes ( DOMNode  $node)
static
Parameters
DOMNode$node

◆ xmlToVariable()

static PHPUnit\Util\Xml::xmlToVariable ( DOMElement  $element)
static

"Convert" a DOMElement object into a PHP variable.

Parameters
DOMElement$element
Returns
mixed

The documentation for this class was generated from the following file: