You are here

public function DsTestTrait::dsCreateBlockField in Display Suite 8.2

Create a block field.

Parameters

array $edit: An optional array of field properties.

string $url: The URL of the manage block page.

6 calls to DsTestTrait::dsCreateBlockField()
BlockFieldPluginTest::testBlockAccess in src/Tests/BlockFieldPluginTest.php
Ensure block is not rendered if block disallows access.
BlockFieldPluginTest::testBlockCache in src/Tests/BlockFieldPluginTest.php
Cache contexts, tags and max-age on the block should get merged into the field build array
BlockFieldPluginTest::testBlockFieldTitleOverride in src/Tests/BlockFieldPluginTest.php
Test block title override.
DynamicFieldPluginTest::testDsFields in src/Tests/DynamicFieldPluginTest.php
Test Display fields.
EntitiesTest::testDsNodeEntity in src/Tests/EntitiesTest.php
Test basic node display fields.

... See full list

File

src/Tests/DsTestTrait.php, line 131

Class

DsTestTrait
Provides common functionality for the Display Suite test classes.

Namespace

Drupal\ds\Tests

Code

public function dsCreateBlockField(array $edit = array(), $url = 'admin/structure/ds/fields/manage_block') {
  $edit += array(
    'name' => 'Test block field',
    'id' => 'test_block_field',
    'entities[node]' => '1',
    'block' => 'system_powered_by_block',
  );
  $this
    ->drupalPostForm($url, $edit, t('Save'));
  $this
    ->assertText(t('The field @name has been saved', array(
    '@name' => $edit['name'],
  )), t('@name field has been saved', array(
    '@name' => $edit['name'],
  )));
}