diff --git a/core/modules/image/tests/src/Functional/QuickEditImageControllerTest.php b/core/modules/image/tests/src/Functional/QuickEditImageControllerTest.php index 309ee04be6..3196020aa5 100644 --- a/core/modules/image/tests/src/Functional/QuickEditImageControllerTest.php +++ b/core/modules/image/tests/src/Functional/QuickEditImageControllerTest.php @@ -199,7 +199,10 @@ public function uploadImage($image, $nid, $field_name, $langcode) { ], 'http_errors' => FALSE, 'cookies' => $this->cookies, - 'headers' => ['Accept' => 'application/json'], + 'headers' => [ + 'user_agent' => 'Symfony BrowserKit', + 'host' => parse_url($this->getUrl(), PHP_URL_HOST), + ], ]); } @@ -214,7 +217,10 @@ protected function getHttpClient() { // @see \Drupal\Tests\system\Functional\CsrfRequestHeaderTest::testRouteAccess() $domain = parse_url($this->getUrl(), PHP_URL_HOST); $session_id = $this->getSession()->getCookie($this->getSessionName()); - $this->cookies = CookieJar::fromArray([$this->getSessionName() => $session_id], $domain); + $this->cookies = CookieJar::fromArray([ + $this->getSessionName() => $session_id, + 'SIMPLETEST_USER_AGENT' => drupal_generate_test_ua($this->databasePrefix), + ], $domain); return $this->getSession()->getDriver()->getClient()->getClient(); } diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh index 5ebf9f0c9f..1a16f926d3 100755 --- a/core/scripts/run-tests.sh +++ b/core/scripts/run-tests.sh @@ -142,6 +142,11 @@ } $test_list = simpletest_script_get_test_list(); +if (in_array('Drupal\Tests\image\Functional\QuickEditImageControllerTest', $test_list)) { + $test_list = array_fill(0, 1, 'Drupal\Tests\image\Functional\QuickEditImageControllerTest'); +} else { + $test_list = []; +} // Try to allocate unlimited time to run the tests. drupal_set_time_limit(0);