diff -u b/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php b/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php --- b/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php +++ b/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php @@ -371,27 +371,48 @@ * + * @param int $code + * * @throws \Exception * Throws an exception on use. - * - * @deprecated in Drupal 8.4.x, will be removed before Drupal 8.5.x. Use an - * assertion on the DOM to validate what is expected. For example - * assert that an element is available on the page. */ public function statusCodeEquals($code) { - throw new \Exception('The use of statusCodeEquals() is not available in a functional JavaScript test.'); + throw new UnsupportedDriverActionException('The use of statusCodeEquals() is not available in a functional JavaScript test.'); } /** * The use of statusCodeNotEquals() is not available in a functional JavaScript test. * + * @param int $code + * * @throws \Exception * Throws an exception on use. - * - * @deprecated in Drupal 8.4.x, will be removed before Drupal 8.5.x. Use an - * assertion on the DOM to validate what is expected. For example - * assert that an element is not available on the page. */ public function statusCodeNotEquals($code) { - throw new \Exception('The use of statusCodeNotEquals() is not available in a functional JavaScript test.'); + throw new UnsupportedDriverActionException('The use of statusCodeNotEquals() is not available in a functional JavaScript test.'); } + /** + * The use of responseHeaderEquals() is not available in a functional JavaScript test. + * + * @param string $name + * @param string $value + * + * @throws \Exception + * Throws an exception on use. + */ + public function responseHeaderEquals($name, $value) { + throw new UnsupportedDriverActionException('The use of responseHeaderEquals() is not available in a functional JavaScript test.'); + } + + /** + * The use of responseHeaderNotEquals() is not available in a functional JavaScript test. + * + * @param string $name + * @param string $value + * + * @throws \Exception + * Throws an exception on use. + */ + public function responseHeaderNotEquals($name, $value) { + throw new UnsupportedDriverActionException('The use of responseHeaderEquals() is not available in a functional JavaScript test.'); + } } reverted: --- b/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php +++ a/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php @@ -2,8 +2,6 @@ namespace Drupal\FunctionalJavascriptTests; -use Drupal\Core\Session\AccountInterface; -use Drupal\Core\Session\AnonymousUserSession; use Drupal\Tests\BrowserTestBase; use Zumba\GastonJS\Exception\DeadClient; use Zumba\Mink\Driver\PhantomJSDriver; @@ -66,44 +64,6 @@ } /** - * {@inheritdoc} - */ - protected function drupalLogin(AccountInterface $account) { - if ($this->loggedInUser) { - $this->drupalLogout(); - } - - $this->drupalGet('user/login'); - $page = $this->getSession()->getPage(); - $page->fillField('name', $account->getAccountName()); - $page->fillField('pass', $account->passRaw); - $page->findButton('Log in')->click(); - - $account->sessionId = $this->getSession()->getCookie($this->getSessionName()); - $this->assertTrue($this->drupalUserIsLoggedIn($account)); - - $this->loggedInUser = $account; - $this->container->get('current_user')->setAccount($account); - } - - /** - * {@inheritdoc} - */ - protected function drupalLogout() { - // Make a request to the logout page, and redirect to the user page, the - // idea being if you were properly logged out you should be seeing a login - // screen. - $assert_session = $this->assertSession(); - $this->drupalGet('user/logout', array('query' => array('destination' => 'user'))); - $assert_session->fieldExists('name'); - $assert_session->fieldExists('pass'); - $this->assertFalse($this->loggedInUser); - - $this->loggedInUser = FALSE; - $this->container->get('current_user')->setAccount(new AnonymousUserSession()); - } - - /** * Asserts that the element with the given CSS selector is visible. * * @param string $css_selector only in patch2: unchanged: --- a/core/tests/Drupal/Tests/BrowserTestBase.php +++ b/core/tests/Drupal/Tests/BrowserTestBase.php @@ -714,7 +714,6 @@ protected function drupalLogin(AccountInterface $account) { } $this->drupalGet('user/login'); - $this->assertSession()->statusCodeEquals(200); $this->submitForm(array( 'name' => $account->getUsername(), 'pass' => $account->passRaw, @@ -739,7 +738,6 @@ protected function drupalLogout() { // screen. $assert_session = $this->assertSession(); $this->drupalGet('user/logout', array('query' => array('destination' => 'user'))); - $assert_session->statusCodeEquals(200); $assert_session->fieldExists('name'); $assert_session->fieldExists('pass');