You are here

protected function LingotekContentTypeBulkCancelTest::createAndTranslateContentTypeWithLinks in Lingotek Translation 3.4.x

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/LingotekContentTypeBulkCancelTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeBulkCancelTest::createAndTranslateContentTypeWithLinks()
  2. 4.0.x tests/src/Functional/LingotekContentTypeBulkCancelTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeBulkCancelTest::createAndTranslateContentTypeWithLinks()
  3. 3.0.x tests/src/Functional/LingotekContentTypeBulkCancelTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeBulkCancelTest::createAndTranslateContentTypeWithLinks()
  4. 3.1.x tests/src/Functional/LingotekContentTypeBulkCancelTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeBulkCancelTest::createAndTranslateContentTypeWithLinks()
  5. 3.2.x tests/src/Functional/LingotekContentTypeBulkCancelTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeBulkCancelTest::createAndTranslateContentTypeWithLinks()
  6. 3.3.x tests/src/Functional/LingotekContentTypeBulkCancelTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeBulkCancelTest::createAndTranslateContentTypeWithLinks()
  7. 3.5.x tests/src/Functional/LingotekContentTypeBulkCancelTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeBulkCancelTest::createAndTranslateContentTypeWithLinks()
  8. 3.6.x tests/src/Functional/LingotekContentTypeBulkCancelTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeBulkCancelTest::createAndTranslateContentTypeWithLinks()
  9. 3.7.x tests/src/Functional/LingotekContentTypeBulkCancelTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeBulkCancelTest::createAndTranslateContentTypeWithLinks()
  10. 3.8.x tests/src/Functional/LingotekContentTypeBulkCancelTest.php \Drupal\Tests\lingotek\Functional\LingotekContentTypeBulkCancelTest::createAndTranslateContentTypeWithLinks()
2 calls to LingotekContentTypeBulkCancelTest::createAndTranslateContentTypeWithLinks()
LingotekContentTypeBulkCancelTest::testContentTypeCancel in tests/src/Functional/LingotekContentTypeBulkCancelTest.php
Tests that a config entity can be cancelled using the bulk operations on the management page.
LingotekContentTypeBulkCancelTest::testContentTypeCancelTarget in tests/src/Functional/LingotekContentTypeBulkCancelTest.php
Tests that a config entity target can be cancelled using the bulk operations on the management page.

File

tests/src/Functional/LingotekContentTypeBulkCancelTest.php, line 136

Class

LingotekContentTypeBulkCancelTest
Tests cancelling config entities using the bulk management form.

Namespace

Drupal\Tests\lingotek\Functional

Code

protected function createAndTranslateContentTypeWithLinks() {
  $assert_session = $this
    ->assertSession();

  // Go to the bulk config management page.
  $this
    ->goToConfigBulkManagementForm('node_type');
  $basepath = \Drupal::request()
    ->getBasePath();
  $assert_session
    ->linkByHrefExists($basepath . '/admin/lingotek/config/upload/node_type/article?destination=' . $basepath . '/admin/lingotek/config/manage');

  // Clicking English must init the upload of content.
  $this
    ->clickLink('EN');
  $this
    ->assertText(t('Article uploaded successfully'));

  // There is a link for checking status.
  $this
    ->clickLink('EN');
  $this
    ->assertText('Article status checked successfully');
  $assert_session
    ->linkByHrefExists($basepath . '/admin/lingotek/config/request/node_type/article/es_ES?destination=' . $basepath . '/admin/lingotek/config/manage');

  // Request the Spanish translation.
  $this
    ->clickLink('ES');
  $this
    ->assertText("Translation to es_ES requested successfully");

  // Check status of the Spanish translation.
  $this
    ->clickLink('ES');
  $this
    ->assertText("Translation to es_ES status checked successfully");

  // Download the Spanish translation.
  $this
    ->clickLink('ES');
  $this
    ->assertText('Translation to es_ES downloaded successfully');
}