PHP 클래스 PHPUnit_Util_XML, qcodo

저자: Sebastian Bergmann ([email protected])
파일 보기 프로젝트 열기: qcodo/qcodo 1 사용 예제들

공개 메소드들

메소드 설명
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