DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

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”.

  1. startTest(Tx_Phpunit_BackEnd_Fixtures_DataProviderTest, name = “test1”)
  2. 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.

  1. startTestSuite(PHPUnit_Framework_TestSuite_DataProvider, name=”Tx_ Phpunit_BackEnd_Fixtures_DataProviderTest::dataProviderTest”)
  2. startTest(Tx_Phpunit_BackEnd_Fixtures_DataProviderTest, name = “dataProviderTest”)
  3. endTest(Tx_Phpunit_BackEnd_Fixtures_DataProviderTest, name = “dataProviderTest”)
  4. (steps 2 and 3 are repeated once for each additional data set)
  5. 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.

  1. startTest(Tx_Phpunit_BackEnd_Fixtures_DataProviderTest, name = “test1”)
  2. endTest(Tx_Phpunit_BackEnd_Fixtures_DataProviderTest, name = “test1”)
  3. (steps 1 and 2 are repeated once for each additional single test before the data provider test, including the correct test function name)
  4. startTestSuite(PHPUnit_Framework_TestSuite_DataProvider, name=”Tx_ Phpunit_BackEnd_Fixtures_DataProviderTest::dataProviderTest”)
  5. startTest(Tx_Phpunit_BackEnd_Fixtures_DataProviderTest, name = “dataProviderTest”)
  6. endTest(Tx_Phpunit_BackEnd_Fixtures_DataProviderTest, name = “dataProviderTest”)
  7. (steps 5 and 6 are repeated once for each additional data set)
  8. endTestSuite(PHPUnit_Framework_TestSuite_DataProvider, name=”Tx_Ph punit_BackEnd_Fixtures_DataProviderTest::dataProviderTest”)
  9. startTest(Tx_Phpunit_BackEnd_Fixtures_DataProviderTest, name = “test3”)
  10. endTest(Tx_Phpunit_BackEnd_Fixtures_DataProviderTest, name = “test3”)
  11. (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

  1. startTestSuite(PHPUnit_Framework_TestSuite, name=”tx_phpunit_basetestsuite”)
  2. startTestSuite(PHPUnit_Framework_TestSuite, name=”Tx_Phpunit_BackEnd_Fixtures_AnotherDataProviderTest”)
  3. (then the same steps as when running a test case by itself)
  4. endTestSuite(PHPUnit_Framework_TestSuite, name=”Tx_Phpunit_BackEnd_Fixtures_AnotherDataProviderTest”)
  5. (steps 2 through 4 are repeated once for each additional test case)
  6. endTestSuite(PHPUnit_Framework_TestSuite, name=”tx_phpunit_basetestsuite”)