You are here

public function LanguageSelectionPageConditionTest::testAjax in Language Selection Page 8.2

Test the "xml_http_request" condition.

File

tests/src/Functional/LanguageSelectionPageConditionTest.php, line 84

Class

LanguageSelectionPageConditionTest
Tests that the condition plugins work.

Namespace

Drupal\Tests\language_selection_page\Functional

Code

public function testAjax() {
  $node = $this
    ->drupalCreateNode();
  $headers = [];
  $this
    ->drupalGet('node/' . $node
    ->id(), [], $headers);
  $this
    ->assertLanguageSelectionPageLoaded();
  $headers['X-Requested-With'] = 'XMLHttpRequest';
  $this
    ->drupalGet('node/' . $node
    ->id(), [], $headers);

  // @todo fix this test.
  $this
    ->assertLanguageSelectionPageNotLoaded();
  $this
    ->resetConfiguration();
}