You are here

public function LingotekNodeBulkDebugTest::testDebugExportError in Lingotek Translation 3.7.x

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/LingotekNodeBulkDebugTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkDebugTest::testDebugExportError()
  2. 4.0.x tests/src/Functional/LingotekNodeBulkDebugTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkDebugTest::testDebugExportError()
  3. 3.0.x tests/src/Functional/LingotekNodeBulkDebugTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkDebugTest::testDebugExportError()
  4. 3.1.x tests/src/Functional/LingotekNodeBulkDebugTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkDebugTest::testDebugExportError()
  5. 3.2.x tests/src/Functional/LingotekNodeBulkDebugTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkDebugTest::testDebugExportError()
  6. 3.3.x tests/src/Functional/LingotekNodeBulkDebugTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkDebugTest::testDebugExportError()
  7. 3.4.x tests/src/Functional/LingotekNodeBulkDebugTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkDebugTest::testDebugExportError()
  8. 3.5.x tests/src/Functional/LingotekNodeBulkDebugTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkDebugTest::testDebugExportError()
  9. 3.6.x tests/src/Functional/LingotekNodeBulkDebugTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkDebugTest::testDebugExportError()
  10. 3.8.x tests/src/Functional/LingotekNodeBulkDebugTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeBulkDebugTest::testDebugExportError()

File

tests/src/Functional/LingotekNodeBulkDebugTest.php, line 112

Class

LingotekNodeBulkDebugTest
Tests debugging a node using the bulk management form.

Namespace

Drupal\Tests\lingotek\Functional

Code

public function testDebugExportError() {

  // Login as admin.
  $this
    ->drupalLogin($this->rootUser);

  // Create a node.
  $node = Node::create([
    'title' => 'Llamas are cool',
    'type' => 'article',
  ]);
  $node
    ->save();

  /** @var \Drupal\lingotek\LingotekContentTranslationServiceInterface $translation_service */
  $translation_service = \Drupal::service('lingotek.content_translation');
  $translation_service
    ->deleteMetadata($node);

  // Enable the debug operations.
  $this
    ->drupalGet('admin/lingotek/settings');
  $this
    ->drupalPostForm(NULL, [], t('Enable debug operations'));
  $this
    ->goToContentBulkManagementForm();
  $key = $this
    ->getBulkSelectionKey('en', 1);
  $edit = [
    $key => TRUE,
    $this
      ->getBulkOperationFormName() => 'debug.export',
  ];
  $this
    ->drupalPostForm(NULL, $edit, $this
    ->getApplyActionsButtonLabel());
  $this
    ->assertText('The Article Llamas are cool has no profile assigned so it was not processed.');
  $this
    ->assertNoText('Exports available');
}