Added by Ralph Schindler, last edited by Ralph Schindler on Mar 27, 2008  (view change)

Labels

 
(None)

Reasons for ZFTestManager

  • Ability to isolate unit test suites and unit test tests.
  • Ability to auto-generate Module's Directory and stock AllTests.php file with stock functionality for autolocating and loading tests.
  • Simplify unit test writing by reducing the learning curve and by adding Zend Framework conventions.
  • Standardized suite/test configuration.. uses native parse_ini_file().
  • Ability to add functionality to the test runner later to better report on test failure. (to be implemented later).

Installing PHPUnit on your box

  • Zend Framework unit tests are written for PHPUnit.
    • New install:
    • Upgrading:
    • Upgrading from PEAR/PHPUnit2:

When you're having trouble installing the newest PHPUnit Version 3 and after upgrading your PEAR say that the newest PHPUnit Version 2.3.6 is already installed the following instuctions will help you

Look per browser at http://pear.phpunit.de/get/ and see what's the latest release...
Today for example the latest release version is http://pear.phpunit.de/get/PHPUnit-3.0.0alpha18.tar.
Now do the following

and you will have the latest PHPUnit Version installed.

Check your version by changing your working directory to PHP and run phpunit on command line.
The actual version and help should show up.

Getting the new unit tests (only until this is in production)

Using ZFTestManager.php / ZFTestManager

  • Help
  • Adding a new Suite
  • Listing Suites
  • Running All Suites
  • Running Isolated Suite
    • Running suite and all branches.
    • Running Single Suite Node, no branches
    • Running Single Suite Node, Single TestCase
    • Running Single Suite Node, Single TestCase, Single Test

Writing Tests

  • See also: Testing Standards
  • see notes inside generated AllTests.php file inside your Suite directory.

ZFTestManager Configuration / TestConfiguration.ini

Global Options

Since 3.2.x PHPUnit supports the --filter-argument which is used to filter tests. I'm not sure whether it is possible to filter complete suites or test cases but as I know Sebastian Bergmann he would be very willing to add something like this.

Please take a look on critic article http://techblog.tilllate.com/2007/06/07/so-what-does-zftestmanager-do/ it makes important point.