|
|
|
File: C:/usr/local/lib/php/blueshoes-4.2/core/lang/phpunit/Bs_Assert.class.php
BlueShoes Application Framework - PhpUnit
Bs_Assert
Bs_Object | +-- Bs_Assert
This class gets extended from Bs_TestCase.
|
private class Bs_Assert extends Bs_Object
This class gets extended from Bs_TestCase.
PHP framework for testing, based on the version from the design of "JUnit".
| Authors | andrej arn <andrej@arn.li> |
| Version | 4.0.$id$ |
| Copyright | blueshoes.org |
|
| |
|
Methods inherited from Bs_Object |
| isex, isexception, tostring, tohtml, persist, unpersist, bs_object, bbsetoutput, bbawake, bbisawake, bbxmsg, bbxfunctionstart, bbxfunctionend, bbxecho, bbxvar, bbxvardump, bbforcetrace, bbbufferstart, bbbufferget, bbbufferendflush, bbbufferendclean |
|
Public Method Summary |
| void |
Bs_Assert()Constructor. |
| void |
assertEquals(string $expected, string $actual, [ string $message ])Checks whether the expected result matches the actual result we got from the function we tested. |
| void |
assertRegexp(string $regexp, string $actual, [ string $message, string $regFunction ])Checks whether the result we got matches our regular expression. |
| void |
assertEqualsType(string $expected, string $actual, [ string $message ])Checks whether the data type of result we got matches our expected data type. |
| void |
assertInstanceOf(string $expected, string $actual, [ string $message ])Checks whether the class of which the result is an instance of matches our expected class name. |
| void |
failNotEquals(string $expected, string $actual, string $expectedLabel, [ string $message ])Private function for reporting failure to match. |
| void |
fail(string $str)YOU HAVE TO OVERWRITE THIS FUNCTION!!! |
|
|
|
Public Method Details |
Bs_Assert |
|
public void Bs_Assert( )
|
| |
Constructor.
|
| Returns |
void |
|
assertEquals |
|
public void assertEquals( string $expected, string $actual, [ string $message ] )
|
| |
Checks whether the expected result matches the actual result we got from the function we tested.
|
| Parameter |
|
|
|
|
|
|
| Returns |
void |
|
assertRegexp |
|
public void assertRegexp( string $regexp, string $actual, [ string $message, string $regFunction ] )
|
| |
Checks whether the result we got matches our regular expression.
|
| Parameter |
|
|
|
|
|
|
|
| string |
$regFunction |
= >>'ereg'<< |
|
default is 'ereg', can also be 'eregi', 'preg_match', ... check the manual. |
|
| Returns |
void |
|
assertEqualsType |
|
public void assertEqualsType( string $expected, string $actual, [ string $message ] )
|
| |
Checks whether the data type of result we got matches our expected data type.
|
| Parameter |
|
| string |
$expected |
|
|
the expected data type, eg 'string' |
|
|
|
|
|
| Returns |
void |
|
assertInstanceOf |
|
public void assertInstanceOf( string $expected, string $actual, [ string $message ] )
|
| |
Checks whether the class of which the result is an instance of matches our expected class name.
|
| Parameter |
|
| string |
$expected |
|
|
the expected class name, eg 'Bs_Date' |
|
|
|
|
|
| Returns |
void |
|
failNotEquals |
|
public void failNotEquals( string $expected, string $actual, string $expectedLabel, [ string $message ] )
|
| |
Private function for reporting failure to match.
When we didn't get the result we expected (or the regexp didn't match) this method gets called.
|
| Parameter |
|
|
|
|
|
|
|
|
| Returns |
void |
|
fail |
|
public void fail( string $str )
|
| |
YOU HAVE TO OVERWRITE THIS FUNCTION!!!
|
| Parameter |
|
|
| Returns |
void |
|
|
Private Method Details |
assert |
|
private void assert( $boolean, string $message )
|
| |
Warning: documentation is missing.
|
| Parameter |
|
|
$boolean |
|
|
Warning: documentation is missing. |
|
|
| string |
$message |
|
|
Warning: documentation is missing. |
|
| Returns |
void |
|
|
|
|
|
| PHPDoc 1.0beta |