HiddenRegionTest.php in Display Suite 8.4
File
tests/src/Functional/HiddenRegionTest.php
View source
<?php
namespace Drupal\Tests\ds\Functional;
class HiddenRegionTest extends TestBase {
public function testHiddenRegion() {
$edit = [
'fs3[hidden_region]' => TRUE,
];
$this
->drupalGet('admin/structure/ds/settings');
$this
->submitForm($edit, 'Save configuration');
$this
->dsSelectLayout();
$settings = [
'type' => 'article',
];
$node = $this
->drupalCreateNode($settings);
$fields = [
'fields[body][region]' => 'right',
'fields[test_field][region]' => 'ds_hidden',
];
$this
->dsConfigureUi($fields);
$this
->drupalGet('node/' . $node
->id());
$this
->assertSession()
->pageTextNotContains('Test field plugin on node ' . $node
->id());
$fields = [
'fields[body][region]' => 'right',
'fields[test_field][region]' => 'right',
];
$this
->dsConfigureUi($fields);
$this
->drupalGet('node/' . $node
->id());
$this
->assertSession()
->pageTextContains('Test field plugin on node ' . $node
->id());
}
}