DiffViewModeTest.php in Diff 8
File
tests/src/Functional/DiffViewModeTest.php
View source
<?php
namespace Drupal\Tests\diff\Functional;
class DiffViewModeTest extends DiffTestBase {
use CoreVersionUiTestTrait;
protected static $modules = [
'field_ui',
];
public function testViewMode() {
$this
->drupalLogin($this->rootUser);
$node = $this
->drupalCreateNode([
'type' => 'article',
'title' => 'Sample node',
'body' => [
'value' => 'Foo',
],
]);
$edit = array(
'body[0][value]' => 'Fighters',
'revision' => TRUE,
);
$this
->drupalPostNodeForm('node/' . $node
->id() . '/edit', $edit, t('Save and keep published'));
$edit = [
'fields[body][region]' => 'hidden',
];
$this
->drupalPostForm('admin/structure/types/manage/article/display', $edit, t('Save'));
$edit = [
'fields[body][region]' => 'hidden',
];
$this
->drupalPostForm('admin/structure/types/manage/article/display/teaser', $edit, t('Save'));
$this
->drupalGet('node/' . $node
->id() . '/revisions');
$this
->drupalPostForm(NULL, [], t('Compare selected revisions'));
$this
->assertNoText('Body');
$this
->assertNoText('Foo');
$this
->assertNoText('Fighters');
}
}