You are here

public function MergeTranslationsFormTest::testMergeTranslations in Merge translations 8

Tests the merge translations form.

Throws

\Behat\Mink\Exception\ExpectationException Thrown for failed expectations.

\Behat\Mink\Exception\ResponseTextException Thrown when an expectation on the response text fails.

File

tests/src/Functional/MergeTranslationsFormTest.php, line 80

Class

MergeTranslationsFormTest
Tests merge node translations.

Namespace

Drupal\Tests\merge_translations\Functional

Code

public function testMergeTranslations() {
  $english_node = $this->entities['en'];
  $this
    ->drupalGet('node/' . $english_node
    ->id() . '/merge_translations');

  // Tests the title of the form.
  $this
    ->assertSession()
    ->pageTextContains('Merge translations of ' . $english_node
    ->label());

  // Tests access to merge translations form.
  $this
    ->assertSession()
    ->statusCodeEquals('200');
  $this
    ->drupalLogout();
  $this
    ->drupalGet('node/' . $english_node
    ->id() . '/merge_translations');
  $this
    ->assertSession()
    ->statusCodeEquals('403');
}