Renaming phpunit to phpunit.php - this will make it possible to have a phpunit folder...
authorTrevor Parscal <tparscal@users.mediawiki.org>
Tue, 7 Sep 2010 22:32:47 +0000 (22:32 +0000)
committerTrevor Parscal <tparscal@users.mediawiki.org>
Tue, 7 Sep 2010 22:32:47 +0000 (22:32 +0000)
maintenance/tests/Makefile
maintenance/tests/phpunit [deleted file]
maintenance/tests/phpunit.php [new file with mode: 0755]

index ece423c..d489c24 100644 (file)
@@ -8,16 +8,16 @@ TEST_FILE_TARGETS=$(subst .php,.target,$(TEST_FILES))
 all test: phpunit
 
 phpunit:
-       php phpunit
+       php phpunit.php
 
 tap:
-       prove -e 'php phpunit --tap' *Test*.php
+       prove -e 'php phpunit.php --tap' *Test*.php
 
 separate: $(TEST_FILE_TARGETS)
 
 # Need --tap because without it, the target specification doesn't work
 $(TEST_FILE_TARGETS) : %.target : %.php
-       php phpunit --tap $<
+       php phpunit.php --tap $<
 
 install:
        pear channel-discover pear.phpunit.de
diff --git a/maintenance/tests/phpunit b/maintenance/tests/phpunit
deleted file mode 100755 (executable)
index d38e016..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/env php
-<?php
-
-require( dirname( __FILE__ ) . '/../commandLine.inc' );
-// XXX: This can go away if everyone switches to PHPUnit 3.5
-if ( @file_get_contents( 'PHPUnit/Autoload.php', true ) !== false ) { 
-       // Works for PHPUnit >= 3.5
-       require_once 'PHPUnit/Autoload.php';
-} else {
-       // Works for PHPUnit < 3.5
-       require_once 'PHPUnit/TextUI/Command.php';
-}
-define( 'MW_PHPUNIT_TEST', 1 );
-
-$wgLocaltimezone = 'UTC';
-
-/* Tests were failing with sqlite */
-global $wgCaches;
-$wgCaches[CACHE_DB] = false;
-
-if ( !version_compare( PHPUnit_Runner_Version::id(), "3.4.1", ">" ) ) {
-       echo <<<EOF
-************************************************************
-
-These tests run best with version PHPUnit 3.4.2 or later.
-Earlier versions may show failures because earlier versions
-of PHPUnit do not properly implement dependencies.
-
-************************************************************
-
-EOF;
-}
-
-class MWPHPUnitCommand extends PHPUnit_TextUI_Command {
-       protected function handleCustomTestSuite() {
-               $suite = new PHPUnit_Framework_TestSuite;
-               if ( !empty( $this->options[1] ) ) {
-                       $files = $this->options[1];
-               } else {
-                       require( dirname( __FILE__ ) . '/TestFileList.php' );
-                       $files = $testFiles;
-                       wfRunHooks( 'UnitTestsList', array( &$files ) );
-               }
-               foreach ( $files as $file ) {
-                       $suite->addTestFile( $file );
-               }
-               $suite->setName( 'MediaWiki test suite' );
-               $this->arguments['test'] = $suite;
-       }
-}
-
-$command = new MWPHPUnitCommand;
-$command->run( $argv );
-
diff --git a/maintenance/tests/phpunit.php b/maintenance/tests/phpunit.php
new file mode 100755 (executable)
index 0000000..d38e016
--- /dev/null
@@ -0,0 +1,54 @@
+#!/usr/bin/env php
+<?php
+
+require( dirname( __FILE__ ) . '/../commandLine.inc' );
+// XXX: This can go away if everyone switches to PHPUnit 3.5
+if ( @file_get_contents( 'PHPUnit/Autoload.php', true ) !== false ) { 
+       // Works for PHPUnit >= 3.5
+       require_once 'PHPUnit/Autoload.php';
+} else {
+       // Works for PHPUnit < 3.5
+       require_once 'PHPUnit/TextUI/Command.php';
+}
+define( 'MW_PHPUNIT_TEST', 1 );
+
+$wgLocaltimezone = 'UTC';
+
+/* Tests were failing with sqlite */
+global $wgCaches;
+$wgCaches[CACHE_DB] = false;
+
+if ( !version_compare( PHPUnit_Runner_Version::id(), "3.4.1", ">" ) ) {
+       echo <<<EOF
+************************************************************
+
+These tests run best with version PHPUnit 3.4.2 or later.
+Earlier versions may show failures because earlier versions
+of PHPUnit do not properly implement dependencies.
+
+************************************************************
+
+EOF;
+}
+
+class MWPHPUnitCommand extends PHPUnit_TextUI_Command {
+       protected function handleCustomTestSuite() {
+               $suite = new PHPUnit_Framework_TestSuite;
+               if ( !empty( $this->options[1] ) ) {
+                       $files = $this->options[1];
+               } else {
+                       require( dirname( __FILE__ ) . '/TestFileList.php' );
+                       $files = $testFiles;
+                       wfRunHooks( 'UnitTestsList', array( &$files ) );
+               }
+               foreach ( $files as $file ) {
+                       $suite->addTestFile( $file );
+               }
+               $suite->setName( 'MediaWiki test suite' );
+               $this->arguments['test'] = $suite;
+       }
+}
+
+$command = new MWPHPUnitCommand;
+$command->run( $argv );
+