TwigRenderTest.php in Display Suite 8.2
File
src/Tests/TwigRenderTest.php
View source
<?php
namespace Drupal\ds\Tests;
class TwigRenderTest extends FastTestBase {
public function testFieldNameTargeting() {
$settings = array(
'type' => 'article',
'promote' => 1,
);
$node = $this
->drupalCreateNode($settings);
$layout = array(
'layout' => 'dstest_1col_title',
);
$layout_assert = array(
'regions' => array(
'ds_content' => '<td colspan="8">' . t('Content') . '</td>',
),
);
$this
->dsSelectLayout($layout, $layout_assert);
$fields = array(
'fields[node_title][region]' => 'ds_content',
);
$this
->dsConfigureUi($fields);
$this
->drupalGet('node/' . $node
->id());
$this
->assertText($node
->getTitle());
$edit = array(
'fs3[use_field_names]' => FALSE,
);
$this
->drupalPostForm('admin/structure/ds/settings', $edit, t('Save configuration'));
$this
->drupalGet('node/' . $node
->id());
$this
->assertNoText($node
->getTitle());
}
}