PHP Class MemberExpectation, simpletest

Inheritance: extends IdenticalExpectation
显示文件 Open project: simpletest/simpletest Class Usage Examples

Public Methods

Method Description
__construct ( $name, $expected ) Sets the value to compare against.
test ( object $actual ) : boolean Tests the expectation. True if the property value is identical.
testMessage ( $actual ) : string Returns a human readable test message.
unmangle ( string $mangled ) : string Removes crud from property name after it's been converted to an array.

Private Methods

Method Description
getPrivatePropertyNoMatterWhat ( string $name, object $object ) : mixed Extracts a private member's value when reflection won't play ball.
getProperty ( string $name, object $object ) : mixed Extracts the member value even if private using reflection.

Method Details

__construct() public method

Sets the value to compare against.
public __construct ( $name, $expected )

test() public method

Tests the expectation. True if the property value is identical.
public test ( object $actual ) : boolean
$actual object Comparison object.
return boolean True if identical.

testMessage() public method

Returns a human readable test message.
public testMessage ( $actual ) : string
return string Description of success or failure.

unmangle() public method

Removes crud from property name after it's been converted to an array.
public unmangle ( string $mangled ) : string
$mangled string Name from array cast.
return string Cleaned up name.