You are here

public function DiffPluginTest::testFieldWithNoPlugin in Diff 8

Tests the changed field without plugins.

File

tests/src/Functional/DiffPluginTest.php, line 62

Class

DiffPluginTest
Tests the Diff module plugins.

Namespace

Drupal\Tests\diff\Functional

Code

public function testFieldWithNoPlugin() {

  // Create an article.
  $node = $this
    ->drupalCreateNode([
    'type' => 'article',
  ]);

  // Update the article and add a new revision, the "changed" field should be
  // updated which does not have plugins provided by diff.
  $edit = [
    'revision' => TRUE,
    'body[0][value]' => 'change',
  ];
  $this
    ->drupalPostNodeForm('node/' . $node
    ->id() . '/edit', $edit, t('Save and keep published'));

  // Check the difference between the last two revisions.
  $this
    ->clickLink(t('Revisions'));
  $this
    ->drupalPostForm(NULL, NULL, t('Compare selected revisions'));

  // "changed" field is not displayed since there is no plugin for it. This
  // should not break the revisions comparison display.
  $this
    ->assertResponse(200);
  $this
    ->assertLink(t('Split fields'));
}