You are here

public function LanguageSelectionPageConditionTest::testPath in Language Selection Page 8.2

Test the "path" condition.

File

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

Class

LanguageSelectionPageConditionTest
Tests that the condition plugins work.

Namespace

Drupal\Tests\language_selection_page\Functional

Code

public function testPath() {
  $node = $this
    ->drupalCreateNode();
  $this
    ->drupalGet('node/' . $node
    ->id());
  $this
    ->assertLanguageSelectionPageLoaded();
  $this
    ->drupalPostForm('admin/config/regional/language/detection/language_selection_page', [
    'path' => '/test',
  ], 'Save configuration');

  // @todo uncomment and fix

  /*
      $this->drupalGet('node/' . $node->id());
      $this->assertLanguageSelectionPageLoaded();
      $this->assertSession()->addressEquals('/test');

      $this->drupalPostForm('admin/config/search/path/add', [
      'langcode' => 'und',
      'source' => '/node/' . $node->id(),
      'alias' => '/test',
      ], 'Save');

      // @todo decide what should happen here
      $this->drupalGet('node/' . $node->id());
      $this->assertLanguageSelectionPageNotLoaded();
  */
  $this
    ->resetConfiguration();
}