protected function LingotekNodeNestedParagraphsEditedTranslationTest::createNestedParagraphedNode in Lingotek Translation 8.2
Same name and namespace in other branches
- 4.0.x tests/src/Functional/LingotekNodeNestedParagraphsEditedTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNestedParagraphsEditedTranslationTest::createNestedParagraphedNode()
- 3.0.x tests/src/Functional/LingotekNodeNestedParagraphsEditedTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNestedParagraphsEditedTranslationTest::createNestedParagraphedNode()
- 3.1.x tests/src/Functional/LingotekNodeNestedParagraphsEditedTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNestedParagraphsEditedTranslationTest::createNestedParagraphedNode()
- 3.2.x tests/src/Functional/LingotekNodeNestedParagraphsEditedTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNestedParagraphsEditedTranslationTest::createNestedParagraphedNode()
- 3.3.x tests/src/Functional/LingotekNodeNestedParagraphsEditedTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNestedParagraphsEditedTranslationTest::createNestedParagraphedNode()
- 3.4.x tests/src/Functional/LingotekNodeNestedParagraphsEditedTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNestedParagraphsEditedTranslationTest::createNestedParagraphedNode()
- 3.5.x tests/src/Functional/LingotekNodeNestedParagraphsEditedTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNestedParagraphsEditedTranslationTest::createNestedParagraphedNode()
- 3.6.x tests/src/Functional/LingotekNodeNestedParagraphsEditedTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNestedParagraphsEditedTranslationTest::createNestedParagraphedNode()
- 3.7.x tests/src/Functional/LingotekNodeNestedParagraphsEditedTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNestedParagraphsEditedTranslationTest::createNestedParagraphedNode()
- 3.8.x tests/src/Functional/LingotekNodeNestedParagraphsEditedTranslationTest.php \Drupal\Tests\lingotek\Functional\LingotekNodeNestedParagraphsEditedTranslationTest::createNestedParagraphedNode()
1 call to LingotekNodeNestedParagraphsEditedTranslationTest::createNestedParagraphedNode()
File
- tests/
src/ Functional/ LingotekNodeNestedParagraphsEditedTranslationTest.php, line 175
Class
- LingotekNodeNestedParagraphsEditedTranslationTest
- Tests translating a node with multiple locales including nested paragraphs.
Namespace
Drupal\Tests\lingotek\FunctionalCode
protected function createNestedParagraphedNode($profile = 'manual') {
$nestedParagraph1 = Paragraph::create([
'type' => 'image_text',
'field_text_demo' => 'Llamas are very cool for the first time',
]);
$nestedParagraph1
->save();
$nestedParagraph2 = Paragraph::create([
'type' => 'image_text',
'field_text_demo' => 'Llamas are very cool for the second time',
]);
$nestedParagraph2
->save();
$paragraph1 = Paragraph::create([
'type' => 'paragraph_container',
'field_paragraphs_demo' => [
$nestedParagraph1,
$nestedParagraph2,
],
]);
$paragraph1
->save();
$nestedParagraph3 = Paragraph::create([
'type' => 'image_text',
'field_text_demo' => 'Dogs are very cool for the first time',
]);
$nestedParagraph3
->save();
$nestedParagraph4 = Paragraph::create([
'type' => 'image_text',
'field_text_demo' => 'Dogs are very cool for the second time',
]);
$nestedParagraph4
->save();
$paragraph2 = Paragraph::create([
'type' => 'paragraph_container',
'field_paragraphs_demo' => [
$nestedParagraph3,
$nestedParagraph4,
],
]);
$paragraph2
->save();
$metadata = LingotekContentMetadata::create([
'profile' => $profile,
]);
$metadata
->save();
$node = Node::create([
'type' => 'paragraphed_nested_content',
'title' => 'Llamas are cool',
'lingotek_metadata' => $metadata,
'field_paragraph_container' => [
$paragraph1,
$paragraph2,
],
'status' => TRUE,
]);
$node
->save();
}