summaryrefslogtreecommitdiff
path: root/includes/SeleniumWebSettings.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-08-12 09:28:15 +0200
committerPierre Schmitz <pierre@archlinux.de>2013-08-12 09:28:15 +0200
commit08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 (patch)
tree577a29fb579188d16003a209ce2a2e9c5b0aa2bd /includes/SeleniumWebSettings.php
parentcacc939b34e315b85e2d72997811eb6677996cc1 (diff)
Update to MediaWiki 1.21.1
Diffstat (limited to 'includes/SeleniumWebSettings.php')
-rw-r--r--includes/SeleniumWebSettings.php27
1 files changed, 13 insertions, 14 deletions
diff --git a/includes/SeleniumWebSettings.php b/includes/SeleniumWebSettings.php
index 7b98568d..7715484e 100644
--- a/includes/SeleniumWebSettings.php
+++ b/includes/SeleniumWebSettings.php
@@ -38,7 +38,7 @@ $cookieName = $cookiePrefix . 'Selenium';
// this is a fallback SQL file
$testSqlFile = false;
$testImageZip = false;
-
+
// if we find a request parameter containing the test name, set a cookie with the test name
if ( isset( $_GET['setupTestSuite'] ) ) {
$setupTestSuiteName = $_GET['setupTestSuite'];
@@ -62,9 +62,9 @@ if ( isset( $_GET['setupTestSuite'] ) ) {
true
);
}
-
+
$testIncludes = array(); // array containing all the includes needed for this test
- $testGlobalConfigs = array(); // an array containg all the global configs needed for this test
+ $testGlobalConfigs = array(); // an array containing all the global configs needed for this test
$testResourceFiles = array(); // an array containing all the resource files needed for this test
$callback = $wgSeleniumTestConfigs[$setupTestSuiteName];
call_user_func_array( $callback, array( &$testIncludes, &$testGlobalConfigs, &$testResourceFiles));
@@ -72,11 +72,11 @@ if ( isset( $_GET['setupTestSuite'] ) ) {
if ( isset( $testResourceFiles['images'] ) ) {
$testImageZip = $testResourceFiles['images'];
}
-
+
if ( isset( $testResourceFiles['db'] ) ) {
$testSqlFile = $testResourceFiles['db'];
$testResourceName = getTestResourceNameFromTestSuiteName( $setupTestSuiteName );
-
+
switchToTestResources( $testResourceName, false ); // false means do not switch database yet
setupTestResources( $testResourceName, $testSqlFile, $testImageZip );
}
@@ -86,7 +86,7 @@ if ( isset( $_GET['setupTestSuite'] ) ) {
if ( isset( $_GET['clearTestSuite'] ) ) {
$testSuiteName = getTestSuiteNameFromCookie( $cookieName );
- $expire = time() - 600;
+ $expire = time() - 600;
setcookie(
$cookieName,
'',
@@ -96,22 +96,22 @@ if ( isset( $_GET['clearTestSuite'] ) ) {
$wgCookieSecure,
true
);
-
+
$testResourceName = getTestResourceNameFromTestSuiteName( $testSuiteName );
teardownTestResources( $testResourceName );
}
// if a cookie is found, run the appropriate callback to get the config params.
-if ( isset( $_COOKIE[$cookieName] ) ) {
+if ( isset( $_COOKIE[$cookieName] ) ) {
$testSuiteName = getTestSuiteNameFromCookie( $cookieName );
if ( !isset( $wgSeleniumTestConfigs[$testSuiteName] ) ) {
return;
}
-
+
$testIncludes = array(); // array containing all the includes needed for this test
- $testGlobalConfigs = array(); // an array containg all the global configs needed for this test
+ $testGlobalConfigs = array(); // an array containing all the global configs needed for this test
$testResourceFiles = array(); // an array containing all the resource files needed for this test
- $callback = $wgSeleniumTestConfigs[$testSuiteName];
+ $callback = $wgSeleniumTestConfigs[$testSuiteName];
call_user_func_array( $callback, array( &$testIncludes, &$testGlobalConfigs, &$testResourceFiles));
if ( isset( $testResourceFiles['db'] ) ) {
@@ -123,9 +123,8 @@ if ( isset( $_COOKIE[$cookieName] ) ) {
require_once( $file );
}
foreach ( $testGlobalConfigs as $key => $value ) {
- if ( is_array( $value ) ) {
+ if ( is_array( $value ) ) {
$GLOBALS[$key] = array_merge( $GLOBALS[$key], $value );
-
} else {
$GLOBALS[$key] = $value;
}
@@ -166,7 +165,7 @@ function setupTestResources( $testResourceName, $testSqlFile, $testImageZip ) {
if ( $testResourceName == '' ) {
die( 'Cannot identify a test the resources should be installed for.' );
}
-
+
// create tables
$dbw = wfGetDB( DB_MASTER );
$dbw->query( 'DROP DATABASE IF EXISTS ' . $testResourceName );