PHP Класс PHPUnit_Util_XML, qcodo

Автор: Sebastian Bergmann ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
assertValidKeys ( array $hash, array $validKeys ) : array Validate list of keys in the associative array.
convertSelectToTag ( string $selector, mixed $content = TRUE ) : array Parse a CSS selector into an associative array suitable for use with findNodes().
cssSelect ( array $selector, string $content, mixed $actual, boolean $isHtml = TRUE ) : false | array Parse an $actual document and return an array of DOMNodes matching the CSS $selector. If an error occurs, it will return FALSE.
findNodes ( DOMDocument $dom, array $options, boolean $isHtml = TRUE ) : array Parse out the options from the tag using DOM object tree.
load ( string | DOMDocument $actual, boolean $isHtml = FALSE, string $filename = '' ) : DOMDocument Load an $actual document into a DOMDocument. This is called from the selector assertions.
loadFile ( string $filename, boolean $isHtml = FALSE ) : DOMDocument Loads an XML (or HTML) file into a DOMDocument object.
nodeToText ( DOMNode $node ) : string
prepareString ( string $string ) : string
removeCharacterDataNodes ( DOMNode $node )
xmlToVariable ( DOMElement $element ) : mixed "Convert" a DOMElement object into a PHP variable.

Защищенные методы

Метод Описание
convertToUtf8 ( string $string ) : string Converts a string to UTF-8 encoding.
getDescendants ( DOMNode $node ) : array Recursively get flat array of all descendants of this node.
getElementsByCaseInsensitiveTagName ( DOMDocument $dom, string $tag ) : DOMNodeList Gets elements by case insensitive tagname.
getNodeText ( DOMNode $node ) : string Get the text value of this node's child text node.
isUtf8 ( string $string ) : boolean Checks a string for UTF-8 encoding.

Описание методов

assertValidKeys() публичный статический Метод

Validate list of keys in the associative array.
Автор: Mike Naberezny ([email protected])
Автор: Derek DeVries ([email protected])
public static assertValidKeys ( array $hash, array $validKeys ) : array
$hash array
$validKeys array
Результат array

convertSelectToTag() публичный статический Метод

Parse a CSS selector into an associative array suitable for use with findNodes().
Автор: Mike Naberezny ([email protected])
Автор: Derek DeVries ([email protected])
public static convertSelectToTag ( string $selector, mixed $content = TRUE ) : array
$selector string
$content mixed
Результат array

convertToUtf8() защищенный статический Метод

Converts a string to UTF-8 encoding.
protected static convertToUtf8 ( string $string ) : string
$string string
Результат string

cssSelect() публичный статический Метод

To only return nodes containing a certain content, give the $content to match as a string. Otherwise, setting $content to TRUE will return all nodes matching $selector. The $actual document may be a DOMDocument or a string containing XML or HTML, identified by $isHtml.
Автор: Mike Naberezny ([email protected])
Автор: Derek DeVries ([email protected])
Автор: Tobias Schlitt ([email protected])
public static cssSelect ( array $selector, string $content, mixed $actual, boolean $isHtml = TRUE ) : false | array
$selector array
$content string
$actual mixed
$isHtml boolean
Результат false | array

findNodes() публичный статический Метод

Parse out the options from the tag using DOM object tree.
Автор: Mike Naberezny ([email protected])
Автор: Derek DeVries ([email protected])
Автор: Tobias Schlitt ([email protected])
public static findNodes ( DOMDocument $dom, array $options, boolean $isHtml = TRUE ) : array
$dom DOMDocument
$options array
$isHtml boolean
Результат array

getDescendants() защищенный статический Метод

Recursively get flat array of all descendants of this node.
Автор: Mike Naberezny ([email protected])
Автор: Derek DeVries ([email protected])
protected static getDescendants ( DOMNode $node ) : array
$node DOMNode
Результат array

getElementsByCaseInsensitiveTagName() защищенный статический Метод

Gets elements by case insensitive tagname.
protected static getElementsByCaseInsensitiveTagName ( DOMDocument $dom, string $tag ) : DOMNodeList
$dom DOMDocument
$tag string
Результат DOMNodeList

getNodeText() защищенный статический Метод

Get the text value of this node's child text node.
Автор: Mike Naberezny ([email protected])
Автор: Derek DeVries ([email protected])
protected static getNodeText ( DOMNode $node ) : string
$node DOMNode
Результат string

isUtf8() защищенный статический Метод

Checks a string for UTF-8 encoding.
protected static isUtf8 ( string $string ) : boolean
$string string
Результат boolean

load() публичный статический Метод

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. 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.
Автор: Mike Naberezny ([email protected])
Автор: Derek DeVries ([email protected])
public static load ( string | DOMDocument $actual, boolean $isHtml = FALSE, string $filename = '' ) : DOMDocument
$actual string | DOMDocument
$isHtml boolean
$filename string
Результат DOMDocument

loadFile() публичный статический Метод

Loads an XML (or HTML) file into a DOMDocument object.
public static loadFile ( string $filename, boolean $isHtml = FALSE ) : DOMDocument
$filename string
$isHtml boolean
Результат DOMDocument

nodeToText() публичный статический Метод

public static nodeToText ( DOMNode $node ) : string
$node DOMNode
Результат string

prepareString() публичный статический Метод

Автор: Kore Nordmann ([email protected])
public static prepareString ( string $string ) : string
$string string
Результат string

removeCharacterDataNodes() публичный статический Метод

Автор: Mattis Stordalen Flister ([email protected])
public static removeCharacterDataNodes ( DOMNode $node )
$node DOMNode

xmlToVariable() публичный статический Метод

"Convert" a DOMElement object into a PHP variable.
public static xmlToVariable ( DOMElement $element ) : mixed
$element DOMElement
Результат mixed