Prev Next

Appendix D. Index

Symbols

$backupGlobalsBlacklist, Global State
$backupStaticAttributesBlacklist, Global State
@assert, Generating a Test Case Class Skeleton, @assert
@author, The Command-Line Test Runner, @author
@backupGlobals, Global State, @backupGlobals
@backupStaticAttributes, Global State, @backupStaticAttributes
@codeCoverageIgnore, Ignoring Code Blocks
@codeCoverageIgnoreEnd, Ignoring Code Blocks
@codeCoverageIgnoreStart, Ignoring Code Blocks
@covers, Specifying Covered Methods, @covers
@dataProvider, Data Providers, @dataProvider
@depends, Test Dependencies, Data Providers, @depends
@expectedException, Testing Exceptions, @expectedException
@expectedExceptionCode, Testing Exceptions, @expectedExceptionCode
@expectedExceptionMessage, Testing Exceptions, @expectedExceptionMessage
@group, The Command-Line Test Runner, @group
@outputBuffering, @outputBuffering
@runInSeparateProcess, @runInSeparateProcess
@runTestsInSeparateProcesses, @runTestsInSeparateProcesses
@test, Writing Tests for PHPUnit, @test
@testdox, @testdox
@ticket, @ticket

A

Agile Documentation, The Command-Line Test Runner, Agile Documentation
Annotation, Writing Tests for PHPUnit, Test Dependencies, Data Providers, Testing Exceptions, The Command-Line Test Runner, Specifying Covered Methods, Ignoring Code Blocks, Generating a Test Case Class Skeleton, Annotations
anything(), assertThat()
arrayHasKey(), assertThat()
assertArrayHasKey(), assertArrayHasKey(), Assertions
assertArrayNotHasKey(), assertArrayHasKey(), Assertions
assertAttributeContains(), assertContains(), Assertions
assertAttributeContainsOnly(), assertContainsOnly(), Assertions
assertAttributeEmpty(), assertEmpty(), Assertions
assertAttributeEquals(), assertEquals(), Assertions
assertAttributeGreaterThan(), assertGreaterThan(), Assertions
assertAttributeGreaterThanOrEqual(), assertGreaterThanOrEqual(), Assertions
assertAttributeInstanceOf(), assertInstanceOf(), Assertions
assertAttributeInternalType(), assertInternalType(), Assertions
assertAttributeLessThan(), assertLessThan(), Assertions
assertAttributeLessThanOrEqual(), assertLessThanOrEqual(), Assertions
assertAttributeNotContains(), assertContains(), Assertions
assertAttributeNotContainsOnly(), assertContainsOnly(), Assertions
assertAttributeNotEmpty(), assertEmpty(), Assertions
assertAttributeNotEquals(), assertEquals(), Assertions
assertAttributeNotInstanceOf(), assertInstanceOf(), Assertions
assertAttributeNotInternalType(), assertInternalType(), Assertions
assertAttributeNotSame(), assertSame(), Assertions
assertAttributeNotType(), assertType(), Assertions
assertAttributeSame(), assertSame(), Assertions
assertAttributeType(), assertType(), Assertions
assertClassHasAttribute(), assertClassHasAttribute(), Assertions
assertClassHasStaticAttribute(), assertClassHasStaticAttribute(), Assertions
assertClassNotHasAttribute(), assertClassHasAttribute(), Assertions
assertClassNotHasStaticAttribute(), assertClassHasStaticAttribute(), Assertions
assertContains(), assertContains(), Assertions
assertContainsOnly(), assertContainsOnly(), Assertions
assertEmpty(), assertEmpty(), Assertions
assertEquals(), assertEquals(), Assertions
assertEqualXMLStructure(), assertEqualXMLStructure(), Assertions
assertFalse(), assertFalse(), Assertions
assertFileEquals(), assertFileEquals(), Assertions
assertFileExists(), assertFileExists(), Assertions
assertFileNotEquals(), assertFileEquals(), Assertions
assertFileNotExists(), assertFileExists(), Assertions
assertGreaterThan(), assertGreaterThan(), Assertions
assertGreaterThanOrEqual(), assertGreaterThanOrEqual(), Assertions
assertInstanceOf(), assertInstanceOf(), Assertions
assertInternalType(), assertInternalType(), Assertions
Assertion, @assert
Assertions, Automating Tests
assertLessThan(), assertLessThan(), Assertions
assertLessThanOrEqual(), assertLessThanOrEqual(), Assertions
assertNotContains(), assertContains(), Assertions
assertNotContainsOnly(), assertContainsOnly(), Assertions
assertNotEmpty(), assertEmpty(), Assertions
assertNotEquals(), assertEquals(), Assertions
assertNotInstanceOf(), assertInstanceOf(), Assertions
assertNotInternalType(), assertInternalType(), Assertions
assertNotNull(), assertNull(), Assertions
assertNotRegExp(), assertRegExp(), Assertions
assertNotSame(), assertSame(), Assertions
assertNotTag(), assertTag(), Assertions
assertNotType(), assertType(), Assertions
assertNull(), assertNull(), Assertions
assertObjectHasAttribute(), assertObjectHasAttribute(), Assertions
assertObjectNotHasAttribute(), assertObjectHasAttribute(), Assertions
assertPostConditions(), Fixtures
assertPreConditions(), Fixtures
assertRegExp(), assertRegExp(), Assertions
assertSame(), assertSame(), Assertions
assertSelectCount(), assertSelectCount(), Assertions
assertSelectEquals(), assertSelectEquals(), Assertions
assertSelectRegExp(), assertSelectRegExp(), Assertions
assertStringEndsNotWith(), assertStringEndsWith(), Assertions
assertStringEndsWith(), assertStringEndsWith(), Assertions
assertStringEqualsFile(), assertStringEqualsFile(), Assertions
assertStringMatchesFormat(), assertStringMatchesFormat(), Assertions
assertStringMatchesFormatFile(), assertStringMatchesFormatFile(), Assertions
assertStringNotEqualsFile(), assertStringEqualsFile(), Assertions
assertStringNotMatchesFormat(), assertStringMatchesFormat(), Assertions
assertStringNotMatchesFormatFile(), assertStringMatchesFormatFile(), Assertions
assertStringStartsNotWith(), assertStringStartsWith(), Assertions
assertStringStartsWith(), assertStringStartsWith(), Assertions
assertTag(), assertTag(), Assertions
assertThat(), assertThat(), Assertions
assertTrue(), assertTrue(), Assertions
assertType(), assertType(), Assertions
assertXmlFileEqualsXmlFile(), assertXmlFileEqualsXmlFile(), Assertions
assertXmlFileNotEqualsXmlFile(), assertXmlFileEqualsXmlFile(), Assertions
assertXmlStringEqualsXmlFile(), assertXmlStringEqualsXmlFile(), Assertions
assertXmlStringEqualsXmlString(), assertXmlStringEqualsXmlString(), Assertions
assertXmlStringNotEqualsXmlFile(), assertXmlStringEqualsXmlFile(), Assertions
assertXmlStringNotEqualsXmlString(), assertXmlStringEqualsXmlString(), Assertions
attribute(), assertThat()
attributeEqualTo(), assertThat()
Automated Documentation, Agile Documentation
Automated Test, Automating Tests

D

Data-Driven Tests, Implement PHPUnit_Framework_Test
DBUS, The Command-Line Test Runner
Defect Localization, Test Dependencies
Depended-On Component, Test Doubles
Design-by-Contract, Test-Driven Development
Documenting Assumptions, Agile Documentation
Domain-Driven Design, Behaviour-Driven Development

F

Failure, The Command-Line Test Runner
fileExists(), assertThat()
Fixture, Fixtures
Fluent Interface, Stubs

G

getMock(), Stubs
getMockBuilder(), Stubs
getMockForAbstractClass(), Mock Objects
getMockFromWsdl(), Stubbing and Mocking Web Services
Global Variable, Global State, Setting PHP INI settings, Constants and Global Variables
greaterThan(), assertThat()
greaterThanOrEqual(), assertThat()

H

hasAttribute(), assertThat()

I

identicalTo(), assertThat()
include_path, The Command-Line Test Runner
Incomplete Test, Incomplete Tests, Generating a Test Case Class Skeleton
isFalse(), assertThat()
isInstanceOf(), assertThat()
isNull(), assertThat()
isTrue(), assertThat()
isType(), assertThat()

L

lessThan(), assertThat()
lessThanOrEqual(), assertThat()
Logfile, The Command-Line Test Runner
Logging, Logging, Logging
logicalAnd(), assertThat()
logicalNot(), assertThat()
logicalOr(), assertThat()
logicalXor(), assertThat()

M

matchesRegularExpression(), assertThat()
method(), Stubs
Mock Object, Mock Objects

O

onConsecutiveCalls(), Stubs
onNotSuccessfulTest(), Fixtures

P

PHP Error, Testing PHP Errors
PHP Notice, Testing PHP Errors
PHP Warning, Testing PHP Errors
php.ini, Setting PHP INI settings, Constants and Global Variables
PHPUnit_Extensions_OutputTestCase, Testing Output
PHPUnit_Extensions_RepeatedTest, Subclass PHPUnit_Extensions_TestDecorator
PHPUnit_Extensions_SeleniumTestCase, PHPUnit_Extensions_SeleniumTestCase
PHPUnit_Extensions_Story_TestCase, Behaviour-Driven Development
PHPUnit_Extensions_TestDecorator, Subclass PHPUnit_Extensions_TestDecorator
PHPUnit_Extensions_TestSetup, Subclass PHPUnit_Extensions_TestDecorator
PHPUnit_Framework_Assert, BankAccount Example
PHPUnit_Framework_Error, Testing PHP Errors
PHPUnit_Framework_Error_Notice, Testing PHP Errors
PHPUnit_Framework_Error_Warning, Testing PHP Errors
PHPUnit_Framework_IncompleteTest, Incomplete Tests
PHPUnit_Framework_IncompleteTestError, Incomplete Tests
PHPUnit_Framework_Test, Implement PHPUnit_Framework_Test
PHPUnit_Framework_TestCase, Writing Tests for PHPUnit, Subclass PHPUnit_Framework_TestCase
PHPUnit_Framework_TestListener, Implement PHPUnit_Framework_TestListener, Test Listeners
PHPUnit_Runner_TestSuiteLoader, The Command-Line Test Runner
PHP_CodeCoverage_Filter, Including and Excluding Files
Process Isolation, The Command-Line Test Runner

R

Refactoring, During Development
Report, The Command-Line Test Runner
returnArgument(), Stubs
returnCallback(), Stubs
returnValue(), Stubs

S

Selenium RC, Selenium RC, Configuring Browsers for Selenium RC
setUp(), Fixtures
setUpBeforeClass, Sharing Fixture
setUpBeforeClass(), Fixtures
Skeleton Generator, The Command-Line Test Runner, Generating a Test Case Class Skeleton
stringContains(), assertThat()
stringEndsWith(), assertThat()
stringStartsWith(), assertThat()
Stub, Stubs
Stubs, Cross-Team Tests
Syntax Check, The Command-Line Test Runner
System Under Test, Test Doubles

T

tearDown(), Fixtures
tearDownAfterClass, Sharing Fixture
tearDownAfterClass(), Fixtures
Template Method, Fixtures
Test Dependencies, Test Dependencies
Test Double, Test Doubles
Test Groups, The Command-Line Test Runner, Groups
Test Isolation, The Command-Line Test Runner, Global State
Test Listener, Test Listeners
Test Suite, Organizing Tests, Test Suites
Test-Driven Development, Test-Driven Development, Behaviour-Driven Development
Test-First Programming, Test-Driven Development
TestDox, Agile Documentation, @testdox
throwException(), Stubs
Prev Next
1. Automating Tests
2. PHPUnit's Goals
3. Installing PHPUnit
4. Writing Tests for PHPUnit
Test Dependencies
Data Providers
Testing Exceptions
Testing PHP Errors
Assertions
assertArrayHasKey()
assertClassHasAttribute()
assertClassHasStaticAttribute()
assertContains()
assertContainsOnly()
assertEmpty()
assertEqualXMLStructure()
assertEquals()
assertFalse()
assertFileEquals()
assertFileExists()
assertGreaterThan()
assertGreaterThanOrEqual()
assertInstanceOf()
assertInternalType()
assertLessThan()
assertLessThanOrEqual()
assertNull()
assertObjectHasAttribute()
assertRegExp()
assertStringMatchesFormat()
assertStringMatchesFormatFile()
assertSame()
assertSelectCount()
assertSelectEquals()
assertSelectRegExp()
assertStringEndsWith()
assertStringEqualsFile()
assertStringStartsWith()
assertTag()
assertThat()
assertTrue()
assertType()
assertXmlFileEqualsXmlFile()
assertXmlStringEqualsXmlFile()
assertXmlStringEqualsXmlString()
5. The Command-Line Test Runner
6. Fixtures
More setUp() than tearDown()
Variations
Sharing Fixture
Global State
7. Organizing Tests
Composing a Test Suite Using the Filesystem
Composing a Test Suite Using XML Configuration
8. TestCase Extensions
Testing Output
9. Database Testing
Supported Vendors for Database Testing
Difficulties in Database-Testing
The four stages of a database test
1. Clean-Up Database
2. Set up fixture
3–5. Run Test, Verify outcome and Teardown
Configuration of a PHPUnit Database TestCase
Implementing getConnection()
Implementing getDataSet()
What about the Datatabase Schema (DDL)?
Tip: Use your own Abstract Database TestCase
Understanding DataSets and DataTables
Available Implementations
Beware of Foreign Keys
Implementing your own DataSets/DataTables
The Connection API
Database Assertions API
Asserting the Row-Count of a Table
Asserting the State of a Table
Asserting the Result of a Query
Asserting the State of Multiple Tables
Frequently Asked Questions
Will PHPUnit (re-)create the database schema for each test?
Am I required to use PDO in my application for the Database Extension to work?
What can I do, when I get a Too much Connections Error?
How to handle NULL with Flat XML / CSV Datasets?
10. Incomplete and Skipped Tests
Incomplete Tests
Skipping Tests
11. Test Doubles
Stubs
Mock Objects
Stubbing and Mocking Web Services
Mocking the Filesystem
12. Testing Practices
During Development
During Debugging
13. Test-Driven Development
BankAccount Example
14. Behaviour-Driven Development
BowlingGame Example
15. Code Coverage Analysis
Specifying Covered Methods
Ignoring Code Blocks
Including and Excluding Files
16. Other Uses for Tests
Agile Documentation
Cross-Team Tests
17. Skeleton Generator
Generating a Test Case Class Skeleton
Generating a Class Skeleton from a Test Case Class
18. PHPUnit and Selenium
Selenium RC
PHPUnit_Extensions_SeleniumTestCase
19. Logging
Test Results (XML)
Test Results (TAP)
Test Results (JSON)
Code Coverage (XML)
20. Extending PHPUnit
Subclass PHPUnit_Framework_TestCase
Write custom assertions
Implement PHPUnit_Framework_TestListener
Subclass PHPUnit_Extensions_TestDecorator
Implement PHPUnit_Framework_Test
A. Assertions
B. Annotations
@assert
@author
@backupGlobals
@backupStaticAttributes
@covers
@dataProvider
@depends
@expectedException
@expectedExceptionCode
@expectedExceptionMessage
@group
@outputBuffering
@runTestsInSeparateProcesses
@runInSeparateProcess
@test
@testdox
@ticket
C. The XML Configuration File
PHPUnit
Test Suites
Groups
Including and Excluding Files for Code Coverage
Logging
Test Listeners
Setting PHP INI settings, Constants and Global Variables
Configuring Browsers for Selenium RC
D. Index
E. Bibliography
F. Copyright