Skip to content
Isaac Leinweber edited this page Dec 11, 2015 · 1 revision

Packaged runner

HackUnit includes a bash compatible executable that will load and run your tests as well as send the report to stdout. The executable is located in the bin/ folder and should be symlinked in your vendor/bin folder for ease of use. Thanks Composer!

Any arguments passed to the runner will be interpreted as paths to scan for tests. You may pass the option -e or --exclude with a value to exclude particular paths. You may pass the exclude option multiple times where all values passed will be excluded.

Custom runner

You may create your own bootstrap process if you wish to extend or replace any of the functionality of HackUnit. See the contents of src/HackUnit.php for a concrete example.

There are three required components for running your test suite.

  • Test Loader: scans the source code for test methods and builds a list of test cases.
  • Test Runner: accepts a list of test cases and executes them, emitting events as appropriate.
  • Test Reporter: listens to events emitted by the Test Runner to build and display a report for the user.
Clone this wiki locally