You are here

public function LingotekNodeParagraphsTranslationTest::testParagraphIsNotCheckedIfTranslationIsRemoved in Lingotek Translation 3.4.x

Same name and namespace in other branches
  1. 4.0.x tests/src/Functional/LingotekNodeParagraphsTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeParagraphsTranslationTest::testParagraphIsNotCheckedIfTranslationIsRemoved()
  2. 3.1.x tests/src/Functional/LingotekNodeParagraphsTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeParagraphsTranslationTest::testParagraphIsNotCheckedIfTranslationIsRemoved()
  3. 3.2.x tests/src/Functional/LingotekNodeParagraphsTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeParagraphsTranslationTest::testParagraphIsNotCheckedIfTranslationIsRemoved()
  4. 3.3.x tests/src/Functional/LingotekNodeParagraphsTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeParagraphsTranslationTest::testParagraphIsNotCheckedIfTranslationIsRemoved()
  5. 3.5.x tests/src/Functional/LingotekNodeParagraphsTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeParagraphsTranslationTest::testParagraphIsNotCheckedIfTranslationIsRemoved()
  6. 3.6.x tests/src/Functional/LingotekNodeParagraphsTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeParagraphsTranslationTest::testParagraphIsNotCheckedIfTranslationIsRemoved()
  7. 3.7.x tests/src/Functional/LingotekNodeParagraphsTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeParagraphsTranslationTest::testParagraphIsNotCheckedIfTranslationIsRemoved()
  8. 3.8.x tests/src/Functional/LingotekNodeParagraphsTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeParagraphsTranslationTest::testParagraphIsNotCheckedIfTranslationIsRemoved()

Tests that when we entity_reference_revisions perform a delete on a paragraph for syncing with its parent, the lingotek_entity_translation_delete() hook doesn't check statuses for a document without document id.

File

tests/src/Functional/LingotekNodeParagraphsTranslationTest.php, line 506

Class

LingotekNodeParagraphsTranslationTest
Tests translating a node with multiple locales including paragraphs.

Namespace

Drupal\Tests\lingotek\Functional

Code

public function testParagraphIsNotCheckedIfTranslationIsRemoved() {
  ConfigurableLanguage::createFromLangcode('de')
    ->setThirdPartySetting('lingotek', 'locale', 'de_DE')
    ->save();
  $this
    ->testNodeWithParagraphsTranslation();

  /** @var \Drupal\paragraphs\ParagraphInterface $paragraph */
  $node = Node::load(1);
  $node
    ->save();
  $paragraph = Paragraph::load(1);
  $paragraph
    ->addTranslation('de');
  $paragraph
    ->save();
  $this
    ->drupalGet('node/1/edit');
  $this
    ->drupalPostForm(NULL, [], 'Remove');
  $this
    ->drupalPostForm(NULL, [], 'Confirm removal');
  $this
    ->drupalPostForm(NULL, [], 'Save');

  // The content is edited successfully.
  $this
    ->assertText('Llamas are cool');
}