public function ContentTmgmtEntitySourceUiTest::testSourceUpdate

Test content entity source preview.

File

sources/content/tests/src/Functional/ContentTmgmtEntitySourceUiTest.php, line 1049

Class

ContentTmgmtEntitySourceUiTest
Content entity source UI tests.

Namespace

Drupal\Tests\tmgmt_content\Functional

Code

public function testSourceUpdate() {

  // Create translatable node.
  $node = $this
    ->createTranslatableNode('article', 'en');
  $job = $this
    ->createJob('en', 'de');
  $job
    ->save();
  $job_item = tmgmt_job_item_create('content', $node
    ->getEntityTypeId(), $node
    ->id(), array(
    'tjid' => $job
      ->id(),
  ));
  $job_item
    ->save();
  $this
    ->drupalGet($node
    ->toUrl('edit-form'));
  $updated_body = 'New body';
  $edit = [
    'body[0][value]' => $updated_body,
  ];
  $this
    ->submitForm($edit, 'Save');
  $this
    ->drupalGet('admin/tmgmt/items/' . $job_item
    ->id());
  $this
    ->assertSession()
    ->pageTextContains($updated_body);
}