You are here

function dsPanelViewModesTests::DSpanelEditLayout in Display Suite 7

Edit a layout on a view mode.

Parameters

$edit: A collection of form properties to submit.

$view_mode: The name of the view mode.

$layout: The name of the layout.

$check_fields: Whether we need to check on fields.

1 call to dsPanelViewModesTests::DSpanelEditLayout()
dsPanelViewModesTests::testPanelViewModes in tests/ds.panels.test
Panels view modes tests.

File

tests/ds.panels.test, line 33
Panel view modes tests.

Class

dsPanelViewModesTests
@file Panel view modes tests.

Code

function DSpanelEditLayout($edit, $view_mode, $layout, $check_fields = FALSE, $type = 'article') {
  $this
    ->drupalPost('admin/structure/types/manage/' . $type . '/display/' . $view_mode . $layout, $edit, t('Save layout'));
  $this
    ->assertText(t('The layout has been saved.'));
  if ($check_fields) {
    $this
      ->assertText('"Node being viewed" Body');
    $this
      ->assertText('"Node being viewed" created date');
    $this
      ->assertText('"Node being viewed" author');
    $this
      ->assertNoText('"Node being viewed" links');
    $this
      ->assertNoText('"Node being viewed" Tags');
    $this
      ->assertNoText('"Node being viewed" title');
    $this
      ->assertNoText('"Node being viewed" comments');
    $this
      ->assertNoText('"Node being viewed" comment form');
    $this
      ->assertNoText('"Node being viewed" Tags');
    $this
      ->assertNoText('"Node being viewed" Image');
  }
}