PHP Objects, Patterns and Practice (3rd edition)

(Barry) #1
■ INDEX

tearDown(), 383, 388


Template Method pattern, 195
Template View pattern, 222
advantages and disadvantages of, 264
allowing views to manage presentation
only, 262
overview of, 262
term(), 476, 478
terminal parsers, 476
testGetUser(), 383
testing
acceptance tests, 379
addUser(), 381
automated testing, 7
Beck, Kent, 5, 382
benefits of, 405
brittle nature of many test harnesses, 404
combining real and mocked components in
testing, 405
Continuous Integration (CI), 322
debugging tests, 404
eliminating errors using a test harness, 322
functional tests, 379
Gamma, Erich, 5
getUser(), 381
introducing errors by changing a
component’s context, 321
JUnit, 5, 382
maintaining a test harness, 380
PHPUnit, 382
running test suites, 385
running tests from the command line, 380
SUnit, 382
test cases, 379
testing at the system level and class level,
403
testing by hand, 380
testing every component regularly, 379
testing for failure, 384
testing that an exception is thrown, 385
unit tests, 379
UserStore class, code listing, 380, 391
validateUser(), 381
Validator class, code listing, 381
xUnit, 382
See also errors; PHPUnit
Tests tab, 446


TextNotifier class, 140
$this pseudo-variable, 20, 42
Thomas, David, 5, 104, 226
ThoughtWorks, 436
throw keyword, 53
throwing an exception, 53
tight coupling, causes of, 454
Tile class, 179
$tile property, 182
TileDecorator class, 182
token(), 473
tokens, 467
TortoiseSVN, 363
__toString(), 16, 65
totalize(), 57
Transaction Script pattern, 222
addVenue(), 268
advantages and disadvantages of, 269
Base class, code listing, 266
doStatement(), 267–268
execute(), 268
implementing, 265
overview of, 265
prepareStatement(), 267
VenueManager class, code listing, 267
trigger(), 477–478
trunk, 365, 367
try clause, 54

■ U
Unicode, 14
Unified Modeling Language (UML), 6
abstract classes, representing, 111
aggregation, 114
associations, unidirectional and
bidirectional, 113
attributes, 111
class diagrams, 110
composition, 115
constraints, 111
Fowler, Martin, 110
inheritance relationships, describing, 112
interfaces, representing, 111
object lifelines, 117
operations, 112
parameters, 112
Free download pdf