* Added wfDie() wrapper, and some manual die(-1), to force the return code
[lhc/web/wiklou.git] / tests / RunTests.php
index 987b1ed..020dba4 100644 (file)
@@ -1,15 +1,16 @@
 <?php
+
+if( php_sapi_name() != 'cli' ) {
+       echo 'Must be run from the command line.';
+       die( -1 );
+}
+
 error_reporting( E_ALL );
 define( "MEDIAWIKI", true );
 
 require_once( 'PHPUnit.php' );
 
 $testOptions = array(
-       'mysql3' => array(
-               'server' => null,
-               'user' => null,
-               'password' => null,
-               'database' => null ),
        'mysql4' => array(
                'server' => null,
                'user' => null,
@@ -29,9 +30,9 @@ if( file_exists( 'LocalTestSettings.php' ) ) {
 $tests = array(
        'GlobalTest',
        'DatabaseTest',
-       'SearchMySQL3Test',
        'SearchMySQL4Test',
        'ArticleTest',
+       'SanitizerTest',
        );
 foreach( $tests as $test ) {
        require_once( $test . '.php' );
@@ -74,7 +75,7 @@ function &buildTestDatabase( $serverType, $tables ) {
                                        . $wgDBprefix . '\\1`', $create);
                                if ($create === $create_tmp) {
                                        # Couldn't do replacement
-                                       die("could not create temporary table $tbl");
+                                       wfDie( "could not create temporary table $tbl" );
                                }
                                $db->query($create_tmp);
                        }