You are here

public function LingotekNodeParagraphsTranslationTest::testParagraphContentMetadataIsSavedWhenContentAdded in Lingotek Translation 3.2.x

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

Tests that metadata is created when a paragraph is added.

File

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

Class

LingotekNodeParagraphsTranslationTest
Tests translating a node with multiple locales including paragraphs.

Namespace

Drupal\Tests\lingotek\Functional

Code

public function testParagraphContentMetadataIsSavedWhenContentAdded() {

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

  // Add paragraphed content.
  $this
    ->drupalGet('node/add/paragraphed_content_demo');
  $this
    ->drupalPostForm(NULL, NULL, t('Add Image + Text'));
  $edit = [];
  $edit['title[0][value]'] = 'Llamas are cool';
  $edit['langcode[0][value]'] = 'en';
  $edit['field_paragraphs_demo[0][subform][field_text_demo][0][value]'] = 'Llamas are very cool';
  $edit['moderation_state[0][state]'] = 'published';
  $this
    ->drupalPostForm(NULL, $edit, t('Save'));
  $metadata = LingotekContentMetadata::loadMultiple();
  $this
    ->assertEqual(2, count($metadata), 'There is metadata saved for the parent entity and the child entity.');
}