SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 133 | Next

Hasin Hayder

"Object-Oriented Programming with PHP5"


Reflection and Unit Testing
[ 130 ]
PHPUnit API
There are several types of asserting API provided by PHPUnit. In our examples
we used ones like assertTrue(), assertEquals(), assertFalse(), and
assertNotNull(). However, there are dozens more. The function names are self
explanatory. The following table is taken from the book PHPUnit Pocket Guide
written by Sebastian Bergmann himself and published by O'Reilly. The book is made
free by O'Reilly and Sebastian Bergmann under the Creative Commons License.
The latest version of this book is currently available at http://www.phpunit.de/
pocket_guide/3.0/en/index.html.
The following table shows all the assert functions possible with PHPUnit:
Assertion Meaning
void assertTrue(bool $condition)
Reports an error if $condition is
FALSE.
void assertTrue(bool $condition, string
$message)
Reports an error identified by
$message if $condition is FALSE.
void assertFalse(bool $condition)
Reports an error if $condition is
TRUE.
void assertFalse(bool $condition,
string $message)
Reports an error identified by
$message if $condition is TRUE.
void assertNull(mixed $variable)
Reports an error if $variable is not
NULL.


Pages:
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6