The order of calls to the test listener when executing tests¶
Between each startTest call and the endTest call, there's a call to one of the following methods for non-successful tests:
addError
addFailure
addIncompleteTest
addSkippedTest
Running a single test (without data provider)¶
The test case is Tx_Phpunit_BackEnd_Fixtures_DataProviderTest, and the test name is “test1”.
startTest(Tx_Phpunit_BackEnd_Fixtures_DataProviderTest, name = “test1”)
endTest(Tx_Phpunit_BackEnd_Fixtures_DataProviderTest, name = “test1”)
Running a single test (with a data provider for three data sets)¶
The test case is Tx_Phpunit_BackEnd_Fixtures_DataProviderTest, and the test name is “dataProviderTest”.
Note: That the data provider keys are not displayed might be a bug either in the PHPUnit package or the phpunit extension.
startTestSuite(PHPUnit_Framework_TestSuite_DataProvider, name=”Tx_ Phpunit_BackEnd_Fixtures_DataProviderTest::dataProviderTest”)
startTest(Tx_Phpunit_BackEnd_Fixtures_DataProviderTest, name = “dataProviderTest”)
endTest(Tx_Phpunit_BackEnd_Fixtures_DataProviderTest, name = “dataProviderTest”)
(steps 2 and 3 are repeated once for each additional data set)
endTestSuite(PHPUnit_Framework_TestSuite_DataProvider, name=”Tx_Ph punit_BackEnd_Fixtures_DataProviderTest::dataProviderTest”)
Running a test case (including a data provider and some single tests)¶
The test case is Tx_Phpunit_BackEnd_Fixtures_DataProviderTest.
startTest(Tx_Phpunit_BackEnd_Fixtures_DataProviderTest, name = “test1”)
endTest(Tx_Phpunit_BackEnd_Fixtures_DataProviderTest, name = “test1”)
(steps 1 and 2 are repeated once for each additional single test before the data provider test, including the correct test function name)
startTestSuite(PHPUnit_Framework_TestSuite_DataProvider, name=”Tx_ Phpunit_BackEnd_Fixtures_DataProviderTest::dataProviderTest”)
startTest(Tx_Phpunit_BackEnd_Fixtures_DataProviderTest, name = “dataProviderTest”)
endTest(Tx_Phpunit_BackEnd_Fixtures_DataProviderTest, name = “dataProviderTest”)
(steps 5 and 6 are repeated once for each additional data set)
endTestSuite(PHPUnit_Framework_TestSuite_DataProvider, name=”Tx_Ph punit_BackEnd_Fixtures_DataProviderTest::dataProviderTest”)
startTest(Tx_Phpunit_BackEnd_Fixtures_DataProviderTest, name = “test3”)
endTest(Tx_Phpunit_BackEnd_Fixtures_DataProviderTest, name = “test3”)
(steps 9 and 10 are repeated once for each additional single test before the data provider test, including the correct test function name)
Running all test cases of an extension¶
startTestSuite(PHPUnit_Framework_TestSuite, name=”tx_phpunit_basetestsuite”)
startTestSuite(PHPUnit_Framework_TestSuite, name=”Tx_Phpunit_BackEnd_Fixtures_AnotherDataProviderTest”)
(then the same steps as when running a test case by itself)
endTestSuite(PHPUnit_Framework_TestSuite, name=”Tx_Phpunit_BackEnd_Fixtures_AnotherDataProviderTest”)
(steps 2 through 4 are repeated once for each additional test case)
endTestSuite(PHPUnit_Framework_TestSuite, name=”tx_phpunit_basetestsuite”)