INDEX
508
notifyPasswordFailure(), 389
onConsecutiveCalls(), 391
overview of, 382
PDO, 404
PHPUnit_Framework_Constraint objects,
386
PHPUnit_Framework_TestCase class, table
of assertion methods, 384
PHPUnit_Framework_TestCase class, table
of some constraint methods, 387
PHPUnit_Framework_TestSuite class, 431
placing test classes in a test directory, 386
refactoring a web application for testing,
394
regression testing, definition of, 394
RequestRegistry class, 396
returnValue(), 391
run(), 395
runCommand(), 397
Runner.php, 394
running test suites, 385
Selenium IDE control panel, 399
setExpectedException(), 385
setting up a library of complex constraints,
387
setUp(), 382–383, 388
stubs, definition of, 389
tearDown(), 383, 388
test case classes, naming, 382
test methods, naming, 383
testGetUser(), 383
testing at the system level and class level,
403
testing for failure, 384
testing that an exception is thrown, 385
User class, code listing, 392
UserStoreTest class, 382
ValidateTest class, code listing, 385
validateUser(), 385, 393
will(), 390
with(), 390
writing web tests, 394
xUnit, 382
See also errors; testing
phpunit alias, 328
PHPUnit_Framework_Constraint objects, 386
PHPUnit_Framework_TestCase class, 382
table of assertion methods, 384
table of some constraint methods, 387
PhpWiki, 460
Pollution class, 182
polymorphism, 454
code examples, 106
conditional statements and, 107, 110
definition of, 106
parallel conditional statements and, 141
Portland Pattern Repository, 126
Preferences class
code listing, 150
getInstance(), 151
mediating object instantiation, 150
Preferences object, instantiating, 151
requirements of, 149
prepareStatement(), 267
presentation layer, 223, 291
Application Controller pattern, 245
Front Controller pattern, 235
Page Controller pattern, 257
Template View pattern, 262
View Helper pattern, 262
view, definition of, 235
See also business logic layer
primitive types
checking the type of a variable, 23
definition of, 22
outputAddresses(), 23
PHP as a loosely typed language, 22
primitive types and test functions, table of,
22
strategies for dealing with argument types,
25
type-related errors, preventing, 25
print_r(), 84, 89, 279
private keyword, 17
procedural programming
cohesion, definition of, 104
comparing to object-oriented design, 100,
103
coupling in, 104
orthogonality, definition of, 104
reading from and writing to configuration
files, code example, 100
readParams(), 100, 103
responsibility and the controlling code, 103

Get PHP Objects, Patterns, and Practice, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.