Runner.php 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. require_once 'Sweety/TestLocator.php';
  3. require_once 'Sweety/Reporter.php';
  4. /**
  5. * Provides the interface for a remote test runner.
  6. * @author Chris Corbyn
  7. * @package Sweety
  8. */
  9. interface Sweety_Runner
  10. {
  11. /** Format for reporting in text mode */
  12. const REPORT_TEXT = 'text';
  13. /** Format for reporting in XML mode */
  14. const REPORT_XML = 'xml';
  15. /** Format for reporting in HTML mode */
  16. const REPORT_HTML = 'html';
  17. /**
  18. * Provide a regular expression to filter away some classes.
  19. * @param string $ignoredClassRegex
  20. */
  21. public function setIgnoredClassRegex($ignoredClassRegex);
  22. /**
  23. * Set the reporter used for showing results/progress.
  24. * @param Sweety_Reporter $reporter
  25. */
  26. public function setReporter(Sweety_Reporter $reporter);
  27. /**
  28. * Register a new test locator instance.
  29. * @param Sweety_TestLocator $locator
  30. */
  31. public function registerTestLocator(Sweety_TestLocator $locator);
  32. /**
  33. * Run all tests in the provided directories.
  34. * @param string[] $directories
  35. * @return int
  36. */
  37. public function runAllTests($dirs = array());
  38. /**
  39. * Run a single test case in isolation using the provided report format.
  40. * @param string $testCase name
  41. * @param string Report format
  42. * @return int
  43. */
  44. public function runTestCase($testName, $format = self::REPORT_TEXT);
  45. }