You are here

public function ContentTmgmtEntitySourceUiTest::testSourceUpdate in Translation Management Tool 8

Test content entity source preview.

File

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

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();
  $updated_body = 'New body';
  $edit = [
    'body[0][value]' => $updated_body,
  ];
  $this
    ->drupalPostForm('node/' . $node
    ->id() . '/edit', $edit, 'Save');
  $this
    ->drupalGet('admin/tmgmt/items/' . $job_item
    ->id());
  $this
    ->assertText($updated_body, 'Source updated correctly.');
}