You are here

public function DsTestTrait::dsEditLimitSettings in Display Suite 8.2

Edit limit.

1 call to DsTestTrait::dsEditLimitSettings()
EntitiesTest::testDsNodeEntity in src/Tests/EntitiesTest.php
Test basic node display fields.

File

src/Tests/DsTestTrait.php, line 89

Class

DsTestTrait
Provides common functionality for the Display Suite test classes.

Namespace

Drupal\ds\Tests

Code

public function dsEditLimitSettings($edit, $field_name = 'body', $url = 'admin/structure/types/manage/article/display') {
  $element_value = 'edit ' . $field_name;
  $this
    ->drupalPostForm($url, array(), $element_value);
  if (isset($edit['fields[' . $field_name . '][settings_edit_form][third_party_settings][ds][ft][id]'])) {
    $this
      ->drupalPostForm(NULL, array(
      'fields[' . $field_name . '][settings_edit_form][third_party_settings][ds][ds_limit]' => $edit['fields[' . $field_name . '][settings_edit_form][third_party_settings][ds][ds_limit]'],
    ), t('Update'));
    $this
      ->drupalPostForm(NULL, array(), $element_value);
    unset($edit['fields[' . $field_name . '][settings_edit_form][third_party_settings][ds][ds_limit]']);
  }
  $this
    ->drupalPostForm(NULL, $edit, t('Update'));
  $this
    ->drupalPostForm(NULL, array(), t('Save'));
}