public function DsTestTrait::dsCreateBlockField in Display Suite 8.4
Same name and namespace in other branches
- 8.3 tests/src/Functional/DsTestTrait.php \Drupal\Tests\ds\Functional\DsTestTrait::dsCreateBlockField()
Create a block field.
Parameters
array $edit: An optional array of field properties.
string $url: The URL of the manage block page.
7 calls to DsTestTrait::dsCreateBlockField()
- BlockFieldPluginTest::testBlockAccess in tests/
src/ Functional/ BlockFieldPluginTest.php - Ensure block is not rendered if block disallows access.
- BlockFieldPluginTest::testBlockAddWrappers in tests/
src/ Functional/ BlockFieldPluginTest.php - Tests the "Add block wrappers and classes" option.
- BlockFieldPluginTest::testBlockCache in tests/
src/ Functional/ BlockFieldPluginTest.php - Tests cache properties on blocks.
- BlockFieldPluginTest::testBlockFieldTitleOverride in tests/
src/ Functional/ BlockFieldPluginTest.php - Test block title override.
- DynamicFieldPluginTest::testDsFields in tests/
src/ Functional/ DynamicFieldPluginTest.php - Test Display fields.
File
- tests/
src/ Functional/ DsTestTrait.php, line 139
Class
- DsTestTrait
- Provides common functionality for the Display Suite test classes.
Namespace
Drupal\Tests\ds\FunctionalCode
public function dsCreateBlockField(array $edit = [], $url = 'admin/structure/ds/fields/manage_block') {
$edit += [
'name' => 'Test block field',
'id' => 'test_block_field',
'entities[node]' => '1',
'block' => 'system_powered_by_block',
];
$this
->drupalGet($url);
$this
->submitForm($edit, 'Save');
$text = t('The field %name has been saved', [
'%name' => $edit['name'],
]);
$this
->assertSession()
->responseContains((string) $text);
}