diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index adc2923..53f5229 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -628,9 +628,9 @@ function drupal_valid_test_ua($new_prefix = NULL) { // string. $http_user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : NULL; $user_agent = isset($_COOKIE['SIMPLETEST_USER_AGENT']) ? $_COOKIE['SIMPLETEST_USER_AGENT'] : $http_user_agent; - if (isset($user_agent) && preg_match("/^(simpletest\d+);(.+);(.+);(.+)$/", $user_agent, $matches)) { + if (isset($user_agent) && preg_match("/^(simpletest\d+):(.+):(.+):(.+)$/", $user_agent, $matches)) { list(, $prefix, $time, $salt, $hmac) = $matches; - $check_string = $prefix . ';' . $time . ';' . $salt; + $check_string = $prefix . ':' . $time . ':' . $salt; // Read the hash salt prepared by drupal_generate_test_ua(). // This function is called before settings.php is read and Drupal's error // handlers are set up. While Drupal's error handling may be properly @@ -687,8 +687,8 @@ function drupal_generate_test_ua($prefix) { } // Generate a moderately secure HMAC based on the database credentials. $salt = uniqid('', TRUE); - $check_string = $prefix . ';' . time() . ';' . $salt; - return $check_string . ';' . Crypt::hmacBase64($check_string, $key); + $check_string = $prefix . ':' . time() . ':' . $salt; + return $check_string . ':' . Crypt::hmacBase64($check_string, $key); } /** diff --git a/core/tests/README.md b/core/tests/README.md new file mode 100644 index 0000000..df091f3 --- /dev/null +++ b/core/tests/README.md @@ -0,0 +1,14 @@ +# Running tests + +## Function tests + +* Start phantomjs: +``` +phantomjs --ssl-protocol=any --ignore-ssl-errors=true vendor/jcalderonzumba/gastonjs/src/Client/main.js 8510 1024 768 2>&1 >> /dev/null & +``` +* Run the function tests: +``` +export SIMPLETEST_DB='mysql://root@localhost/dev_d8' +export SIMPLETEST_BASE_URL='http://d8.dev' +vendor/bin/phpunit -c core core/modules/simpletest/tests/src/Functional/BrowserTestBaseTest.php +```