X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FSeleniumWebSettings.php;h=7715484eb52c8847c59e5ae3f050a3070d1277cd;hb=ba6b41a520546706256904445a011d382ea3d591;hp=7b98568d7459fa99f7679ed9a57e7f7f04f56f7e;hpb=2f5914c2ce4c612920dd96f5ef66e3bd342d2195;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SeleniumWebSettings.php b/includes/SeleniumWebSettings.php index 7b98568d74..7715484eb5 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 );