public function HiddenRegionTest::testHiddenRegion in Display Suite 8.4
Same name and namespace in other branches
- 8.3 tests/src/Functional/HiddenRegionTest.php \Drupal\Tests\ds\Functional\HiddenRegionTest::testHiddenRegion()
Tests hidden region functionality.
File
- tests/
src/ Functional/ HiddenRegionTest.php, line 15
Class
- HiddenRegionTest
- Tests for testing the hidden region option.
Namespace
Drupal\Tests\ds\FunctionalCode
public function testHiddenRegion() {
// Enable the hidden region option.
$edit = [
'fs3[hidden_region]' => TRUE,
];
$this
->drupalGet('admin/structure/ds/settings');
$this
->submitForm($edit, 'Save configuration');
$this
->dsSelectLayout();
// Create a node.
$settings = [
'type' => 'article',
];
$node = $this
->drupalCreateNode($settings);
// Configure fields.
$fields = [
'fields[body][region]' => 'right',
'fields[test_field][region]' => 'ds_hidden',
];
$this
->dsConfigureUi($fields);
// Test field not printed.
$this
->drupalGet('node/' . $node
->id());
$this
->assertSession()
->pageTextNotContains('Test field plugin on node ' . $node
->id());
// Configure fields.
$fields = [
'fields[body][region]' => 'right',
'fields[test_field][region]' => 'right',
];
$this
->dsConfigureUi($fields);
// Test field printed.
$this
->drupalGet('node/' . $node
->id());
$this
->assertSession()
->pageTextContains('Test field plugin on node ' . $node
->id());
}