X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fsimpletest%2Fsrc%2FTests%2FSimpleTestBrowserTest.php;h=957391db76c480155eab42d320cc8feddefe5751;hb=1c1cb0980bfa6caf0c24cce671b6bb541dc87583;hp=7e4f9125b2b8b4b5748cf4ca9b3e76eac6f2a03c;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/core/modules/simpletest/src/Tests/SimpleTestBrowserTest.php b/web/core/modules/simpletest/src/Tests/SimpleTestBrowserTest.php index 7e4f9125b..957391db7 100644 --- a/web/core/modules/simpletest/src/Tests/SimpleTestBrowserTest.php +++ b/web/core/modules/simpletest/src/Tests/SimpleTestBrowserTest.php @@ -59,7 +59,7 @@ class SimpleTestBrowserTest extends WebTestBase { $this->maximumRedirects = 1; $edit = [ 'name' => $user->getUsername(), - 'pass' => $user->pass_raw + 'pass' => $user->pass_raw, ]; $this->drupalPostForm('user/login', $edit, t('Log in'), [ 'query' => ['destination' => 'user/logout'], @@ -87,7 +87,7 @@ class SimpleTestBrowserTest extends WebTestBase { $this->drupalLogout(); $system_path = $base_url . '/' . drupal_get_path('module', 'system'); - $HTTP_path = $system_path . '/tests/http.php/user/login'; + $http_path = $system_path . '/tests/http.php/user/login'; $https_path = $system_path . '/tests/https.php/user/login'; // Generate a valid simpletest User-Agent to pass validation. $this->assertTrue(preg_match('/test\d+/', $this->databasePrefix, $matches), 'Database prefix contains test prefix.'); @@ -95,14 +95,14 @@ class SimpleTestBrowserTest extends WebTestBase { $this->additionalCurlOptions = [CURLOPT_USERAGENT => $test_ua]; // Test pages only available for testing. - $this->drupalGet($HTTP_path); + $this->drupalGet($http_path); $this->assertResponse(200, 'Requesting http.php with a legitimate simpletest User-Agent returns OK.'); $this->drupalGet($https_path); $this->assertResponse(200, 'Requesting https.php with a legitimate simpletest User-Agent returns OK.'); // Now slightly modify the HMAC on the header, which should not validate. $this->additionalCurlOptions = [CURLOPT_USERAGENT => $test_ua . 'X']; - $this->drupalGet($HTTP_path); + $this->drupalGet($http_path); $this->assertResponse(403, 'Requesting http.php with a bad simpletest User-Agent fails.'); $this->drupalGet($https_path); $this->assertResponse(403, 'Requesting https.php with a bad simpletest User-Agent fails.'); @@ -110,7 +110,7 @@ class SimpleTestBrowserTest extends WebTestBase { // Use a real User-Agent and verify that the special files http.php and // https.php can't be accessed. $this->additionalCurlOptions = [CURLOPT_USERAGENT => 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12']; - $this->drupalGet($HTTP_path); + $this->drupalGet($http_path); $this->assertResponse(403, 'Requesting http.php with a normal User-Agent fails.'); $this->drupalGet($https_path); $this->assertResponse(403, 'Requesting https.php with a normal User-Agent fails.');