Permalink
Browse files

Adding class doc blocks to `test\Report`.

  • Loading branch information...
jperras committed Jul 6, 2010
1 parent bfbee4a commit 8dd750360a9d1eef1b0293df37820260267efd8d
Showing with 46 additions and 1 deletion.
  1. +46 −1 libraries/lithium/test/Report.php
@@ -13,7 +13,52 @@
use \lithium\util\Inflector;
/**
- * Report object for running group tests holding results.
+ * This `Report` object aggregates tests in a group and allows you to run said tests to
+ * obtain the results and stats (passes, fails, exceptions, skips) of the test run.
+ *
+ * While Lithium already comes with a text-based as well as web-based test interface, you
+ * may use or extend the `Report` class to create your own test reporter functionality. In
+ * addition, you can also create your own custom templates for displaying results in a different
+ * format, such as json.
+ *
+ * Example usage, for built-in HTML format/reporter:
+ *
+ * {{{
+ * $report = new Report(array(
+ * 'title' => 'Test Report Title',
+ * 'group' => new Group(array('data' => array('\lithium\tests\cases\net\http\MediaTest'))),
+ * 'format' => 'html',
+ * 'reporter' => 'html'
+ * ));
+ *
+ * $report->run();
+ *
+ * //Get the test stats:
+ * $report->stats();
+ *
+ * //Get test results:
+ * $report->results
+ * }}}
+ *
+ * You may also choose to filter the results of the test runs to obtain additional information.
+ * For example, say you wish to calculate the cyclomatic complexity of the classes you are testing:
+ *
+ * {{{
+ * $report = new Report(array(
+ * 'title' => 'Test Report Title',
+ * 'group' => new Group(array('data' => array('\lithium\tests\cases\net\http\MediaTest'))),
+ * 'filters' => array('Complexity')
+ * ));
+ *
+ * $report->run();
+ *
+ * //Get test results, including filter results:
+ * $report->results
+ * }}}
+ *
+ * @see lithium\test\Group
+ * @see lithium\test\filter
+ * @see lithium\test\templates
*/
class Report extends \lithium\core\Object {

0 comments on commit 8dd7503

Please sign in to comment.