You are here

public function ContentTranslationTest::testBasicContentTranslation in Thunder 8.5

Same name and namespace in other branches
  1. 8.3 tests/src/Functional/Integration/ContentTranslationTest.php \Drupal\Tests\thunder\Functional\Integration\ContentTranslationTest::testBasicContentTranslation()
  2. 8.4 tests/src/Functional/Integration/ContentTranslationTest.php \Drupal\Tests\thunder\Functional\Integration\ContentTranslationTest::testBasicContentTranslation()
  3. 6.2.x tests/src/Functional/Integration/ContentTranslationTest.php \Drupal\Tests\thunder\Functional\Integration\ContentTranslationTest::testBasicContentTranslation()
  4. 6.0.x tests/src/Functional/Integration/ContentTranslationTest.php \Drupal\Tests\thunder\Functional\Integration\ContentTranslationTest::testBasicContentTranslation()
  5. 6.1.x tests/src/Functional/Integration/ContentTranslationTest.php \Drupal\Tests\thunder\Functional\Integration\ContentTranslationTest::testBasicContentTranslation()

Test that basic translation creation works.

File

tests/src/Functional/Integration/ContentTranslationTest.php, line 46

Class

ContentTranslationTest
Tests integration with the content_translation.

Namespace

Drupal\Tests\thunder\Functional\Integration

Code

public function testBasicContentTranslation() {
  $this
    ->logWithRole('editor');
  $page = $this
    ->getSession()
    ->getPage();
  $this
    ->drupalGet('node/add/article');
  $page
    ->selectFieldOption('Channel', 'News');
  $page
    ->fillField('Title', 'English draft');
  $page
    ->fillField('SEO Title', 'English draft');
  $page
    ->pressButton('Save');
  $node = $this
    ->getNodeByTitle('English draft');
  $url = $node
    ->toUrl('drupal:content-translation-add');
  $url
    ->setRouteParameter('source', 'en');
  $url
    ->setRouteParameter('target', 'de');
  $this
    ->drupalGet($url);
  $page
    ->fillField('Title', 'German draft');
  $page
    ->pressButton('Save');
}