You are here

public function RedirectTest::testRedirectFromOldToNewUrl in Thunder 6.1.x

Same name and namespace in other branches
  1. 8.5 tests/src/Functional/Integration/RedirectTest.php \Drupal\Tests\thunder\Functional\Integration\RedirectTest::testRedirectFromOldToNewUrl()
  2. 8.2 tests/src/Functional/Integration/RedirectTest.php \Drupal\Tests\thunder\Functional\Integration\RedirectTest::testRedirectFromOldToNewUrl()
  3. 8.3 tests/src/Functional/Integration/RedirectTest.php \Drupal\Tests\thunder\Functional\Integration\RedirectTest::testRedirectFromOldToNewUrl()
  4. 8.4 tests/src/Functional/Integration/RedirectTest.php \Drupal\Tests\thunder\Functional\Integration\RedirectTest::testRedirectFromOldToNewUrl()
  5. 6.2.x tests/src/Functional/Integration/RedirectTest.php \Drupal\Tests\thunder\Functional\Integration\RedirectTest::testRedirectFromOldToNewUrl()
  6. 6.0.x tests/src/Functional/Integration/RedirectTest.php \Drupal\Tests\thunder\Functional\Integration\RedirectTest::testRedirectFromOldToNewUrl()

Tests redirect from old URL to new one.

File

tests/src/Functional/Integration/RedirectTest.php, line 22

Class

RedirectTest
Tests integration with the redirect.

Namespace

Drupal\Tests\thunder\Functional\Integration

Code

public function testRedirectFromOldToNewUrl() {
  $this
    ->logWithRole('editor');
  $this
    ->drupalGet('burda-launches-open-source-cms-thunder');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $page = $this
    ->getSession()
    ->getPage();
  $node = $this
    ->loadNodeByUuid('0bd5c257-2231-450f-b4c2-ab156af7b78d');
  $this
    ->drupalGet($node
    ->toUrl('edit-form'));
  $page
    ->fillField('SEO Title', 'Burda Launches Worldwide Coalition');
  $page
    ->find('xpath', '//*[@id="edit-moderation-state-0"]')
    ->selectOption('published');
  $page
    ->pressButton('Save');
  $this
    ->drupalGet('burda-launches-open-source-cms-thunder');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertSession()
    ->addressEquals('burda-launches-worldwide-coalition');
}