API Documentation

Test/PHPUnit/Constraint/DomQuery.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Test
subpackage
PHPUnit
version
$Id: DomQuery.php 22562 2010-07-15 17:55:57Z dragonbe $
Classes
Zend_Test_PHPUnit_Constraint_DomQuery

Description

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Zend_Test_PHPUnit_Constraint_DomQuery

Extends from
PHPUnit_Framework_Constraint
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Test
subpackage
PHPUnit
uses
PHPUnit_Framework_Constraint
Constants
ASSERT_QUERY
ASSERT_CONTENT_CONTAINS
ASSERT_CONTENT_REGEX
ASSERT_CONTENT_COUNT
ASSERT_CONTENT_COUNT_MIN
ASSERT_CONTENT_COUNT_MAX
Properties
$_assertType
$_assertTypes
$_content
$_negate
$_path
$_useXpath
Methods
__construct
setNegate
setUseXpath
evaluate
fail
toString
_matchContent
_notMatchContent
_regexContent
_notRegexContent
_countContent
_getNodeContent

Description

Zend_Dom_Query-based PHPUnit Constraint

Constants

ASSERT_QUERY

 ASSERT_QUERY = 'assertQuery'

Details

value
assertQuery

ASSERT_CONTENT_CONTAINS

 ASSERT_CONTENT_CONTAINS = 'assertQueryContentContains'

Details

value
assertQueryContentContains

ASSERT_CONTENT_REGEX

 ASSERT_CONTENT_REGEX = 'assertQueryContentRegex'

Details

value
assertQueryContentRegex

ASSERT_CONTENT_COUNT

 ASSERT_CONTENT_COUNT = 'assertQueryCount'

Details

value
assertQueryCount

ASSERT_CONTENT_COUNT_MIN

 ASSERT_CONTENT_COUNT_MIN = 'assertQueryCountMin'

Details

value
assertQueryCountMin

ASSERT_CONTENT_COUNT_MAX

 ASSERT_CONTENT_COUNT_MAX = 'assertQueryCountMax'

Details

value
assertQueryCountMax

Properties

$_assertType

string $_assertType = 'null'

Current assertion type

Details

$_assertType
string
visibility
protected
default
null
final
false
static
false

$_assertTypes

array $_assertTypes = 'array'

Available assertion types

Details

$_assertTypes
array
visibility
protected
default
array
final
false
static
false

$_content

string $_content = 'null'

Content being matched

Details

$_content
string
visibility
protected
default
null
final
false
static
false

$_negate

bool $_negate = 'false'

Whether or not assertion is negated

Details

$_negate
bool
visibility
protected
default
false
final
false
static
false

$_path

string $_path = 'null'

CSS selector or XPath path to select against

Details

$_path
string
visibility
protected
default
null
final
false
static
false

$_useXpath

bool $_useXpath = 'false'

Whether or not to use XPath when querying

Details

$_useXpath
bool
visibility
protected
default
false
final
false
static
false

Methods

__construct

__construct( string $path ) : void

Constructor; setup constraint state

Arguments
$path
string
CSS selector path
Details
visibility
public
final
false
static
false

_countContent

_countContent( Zend_Dom_Query_Result $result, int $test, string $type ) : boolean

Determine if content count matches criteria

Arguments
$result
Zend_Dom_Query_Result
$test
int
Value against which to test
$type
string
assertion type
Output
boolean
Details
visibility
protected
final
false
static
false

_getNodeContent

_getNodeContent( DOMNode $node ) : string

Get node content, minus node markup tags

Arguments
$node
DOMNode
Output
string
Details
visibility
protected
final
false
static
false

_matchContent

_matchContent( Zend_Dom_Query_Result $result, string $match ) : bool

Check to see if content is matched in selected nodes

Arguments
$result
Zend_Dom_Query_Result
$match
string
Content to match
Output
bool
Details
visibility
protected
final
false
static
false

_notMatchContent

_notMatchContent( Zend_Dom_Query_Result $result, string $match ) : bool

Check to see if content is NOT matched in selected nodes

Arguments
$result
Zend_Dom_Query_Result
$match
string
Output
bool
Details
visibility
protected
final
false
static
false

_notRegexContent

_notRegexContent( Zend_Dom_Query_Result $result, string $pattern ) : bool

Check to see if content is NOT matched by regex in selected nodes

Arguments
$result
Zend_Dom_Query_Result
$pattern
string
Output
bool
Details
visibility
protected
final
false
static
false

_regexContent

_regexContent( Zend_Dom_Query_Result $result, string $pattern ) : bool

Check to see if content is matched by regex in selected nodes

Arguments
$result
Zend_Dom_Query_Result
$pattern
string
Output
bool
Details
visibility
protected
final
false
static
false

evaluate

evaluate( string $other, null|string $assertType = null ) : bool

Evaluate an object to see if it fits the constraints

Arguments
$other
string
String to examine
$assertType
nullstring
Assertion type
Output
bool
Details
visibility
public
final
false
static
false

fail

fail( mixed $other, string $description, bool $not = false ) : void

Report Failure

Arguments
$other
mixed
CSS selector path
$description
string
$not
bool
Details
visibility
public
final
false
static
false
see
PHPUnit_Framework_Constraint for implementation details
throws

setNegate

setNegate( bool $flag = true ) : void

Indicate negative match

Arguments
$flag
bool
Details
visibility
public
final
false
static
false

setUseXpath

setUseXpath( bool $flag = true ) : Zend_Test_PHPUnit_Constraint_DomQuery

Whether or not path is a straight XPath expression

Arguments
$flag
bool
Details
visibility
public
final
false
static
false

toString

toString( ) : string

Complete implementation

Output
string
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.