ezsystems/ezpublish-legacy — pull request #700 by jeromegamez (2013-07-29 16:14:06+00:00)
Title: Refactored ezpTestRunner

The current implementation of `ezpTestRunner` has copied some methods from `PHPUnit_TextUI_Command` to be able to override some default behaviour (e.g. the need to specify a test target) and to add some functionality (e.g. listing all available tests in the project). Unfortunately, some functionality besides the 'raw' unit testing doesn't work anymore, e.g. creating code coverage reports, or specifying an extension directory to perform only those tests.

With this patch, the following functions are (re-)enabled:

- [x] Create code coverage reports, e.g.
- `php tests/runtests.php --dsn "$DB://${DB_USER}@127.0.0.1/$DB_NAME" --coverage-html=/path/to/dir`
- [x] Whitelist the eZ Publish legacy kernel, lib and extension classes
- see method `createCodeCoverageFilter()`
- [x] Test single extensions or suites by specifying a tests folder or an extension identifier, e.g.
- `php tests/runtests.php --dsn "$DB://${DB_USER}@127.0.0.1/$DB_NAME" ezoe`
- `php tests/runtests.php --dsn "$DB://${DB_USER}@127.0.0.1/$DB_NAME" extension/ezeo/tests`
- `php tests/runtests.php --dsn "$DB://${DB_USER}@127.0.0.1/$DB_NAME" tests/tests/kernel/suite.php`
- [x] [New] Display a list of available test suites
- `php tests/runtests.php --dsn "$DB://${DB_USER}@127.0.0.1/$DB_NAME" --list-suites`
- `php tests/runtests.php --dsn "$DB://${DB_USER}@127.0.0.1/$DB_NAME" --list-suites ezoe`
- [x] Future proofness for coming PHPUnit releases by overriding methods as little as needed
- `handleArguments()` now only adds functionality
- `run()` is not overriden at all any more

If the Travis build succeeds, I'd consider this a good omen :).

:octocat: Jérôme