MediaWikiPHPUnitCommand.php 745 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. class MediaWikiPHPUnitCommand extends PHPUnit_TextUI_Command {
  3. private $cliArgs;
  4. public function __construct( $ignorableOptions, $cliArgs ) {
  5. $ignore = function ( $arg ) {
  6. };
  7. foreach ( $ignorableOptions as $option ) {
  8. $this->longOptions[$option] = $ignore;
  9. }
  10. $this->cliArgs = $cliArgs;
  11. }
  12. protected function handleCustomTestSuite() {
  13. // Use our suite.xml
  14. if ( !isset( $this->arguments['configuration'] ) ) {
  15. $this->arguments['configuration'] = __DIR__ . '/suite.xml';
  16. }
  17. // Add our own listener
  18. $this->arguments['listeners'][] = new MediaWikiPHPUnitTestListener;
  19. }
  20. protected function createRunner() {
  21. $runner = new MediaWikiTestRunner;
  22. $runner->setMwCliArgs( $this->cliArgs );
  23. return $runner;
  24. }
  25. }