-#!/usr/bin/php
+#!/usr/bin/env php
<?php
/**
* @file
* @ingroup Maintenance
- * @copyright Copyright © Wikimedia Deuschland, 2009
+ * @copyright Copyright © Wikimedia Deuschland, 2009
* @author Hallo Welt! Medienwerkstatt GmbH
* @author Markus Glaser, Dan Nessett, Priyanka Dhanda
* initial idea by Daniel Kinzler
* http://www.gnu.org/copyleft/gpl.html
*/
-$IP = dirname( __DIR__ );
+if ( PHP_SAPI != 'cli' ) {
+ die( "Run me from the command line please.\n" );
+}
define( 'SELENIUMTEST', true );
-//require_once( __DIR__ . '/../maintenance/commandLine.inc' );
require( __DIR__ . '/../maintenance/Maintenance.php' );
-require_once( 'PHPUnit/Runner/Version.php' );
+require_once 'PHPUnit/Runner/Version.php';
if ( version_compare( PHPUnit_Runner_Version::id(), '3.5.0', '>=' ) ) {
# PHPUnit 3.5.0 introduced a nice autoloader based on class name
- require_once( 'PHPUnit/Autoload.php' );
+ require_once 'PHPUnit/Autoload.php';
} else {
- # Keep the old pre PHPUnit 3.5.0 behaviour for compatibility
- require_once( 'PHPUnit/TextUI/Command.php' );
+ # Keep the old pre PHPUnit 3.5.0 behavior for compatibility
+ require_once 'PHPUnit/TextUI/Command.php';
}
-require_once( 'PHPUnit/Extensions/SeleniumTestCase.php' );
-include_once( 'PHPUnit/Util/Log/JUnit.php' );
+require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
+include_once 'PHPUnit/Util/Log/JUnit.php';
require_once( __DIR__ . "/selenium/SeleniumServerManager.php" );
protected function startServer() {
if ( $this->seleniumServerExecPath == '' ) {
- die ( "The selenium server exec path is not set in " .
+ die( "The selenium server exec path is not set in " .
"selenium_settings.ini. Cannot start server \n" .
"as requested - terminating RunSeleniumTests\n" );
}
case 'started':
break;
case 'failed':
- die ( "Unable to start the Selenium Server - " .
+ die( "Unable to start the Selenium Server - " .
"terminating RunSeleniumTests\n" );
case 'running':
- echo ( "Warning: The Selenium Server is " .
- "already running\n" );
+ echo "Warning: The Selenium Server is " .
+ "already running\n";
break;
}
}
protected function stopServer() {
- if ( !isset ( $this->serverManager ) ) {
- echo ( "Warning: Request to stop Selenium Server, but it was " .
+ if ( !isset( $this->serverManager ) ) {
+ echo "Warning: Request to stop Selenium Server, but it was " .
"not stared by RunSeleniumTests\n" .
"RunSeleniumTests cannot stop a Selenium Server it " .
- "did not start\n" );
+ "did not start\n";
} else {
switch ( $this->serverManager->stop() ) {
case 'stopped':
break;
case 'failed':
- echo ( "unable to stop the Selenium Server\n" );
+ echo "unable to stop the Selenium Server\n";
}
}
return;
$maintClass = "SeleniumTester";
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;