You are here

function PanelizerTestHelper::createNode in Panelizer 7.3

Create a node for testing.

@params array $options A list of additional arguments to be passed to the node/add/page form.

Return value

object A node object.

10 calls to PanelizerTestHelper::createNode()
PanelizerExportablesTest::testExportablesChangeablePreEntity in tests/panelizer.exportables.test
Verify that the exported configuration can be edited when applied to an individual entity.
PanelizerNodeTest::testNodeCustomDisplay in tests/panelizer.node.test
Confirm that overriding a default display works correctly.
PanelizerNodeTest::testNodePanelizerAdminTheme in tests/panelizer.node.test
Verify that the admin theme is displayed appropriately.
PanelizerNodeTest::testPageConfiguration in tests/panelizer.node.test
Verify that the "Basic page" content type can be panelized.
PanelizerNodeTest::testPageMultipleDisplays in tests/panelizer.node.test
Verify that multiple displays work.

... See full list

File

tests/panelizer.helper.test, line 168
Test integration for the panelizer module.

Class

PanelizerTestHelper
This will be extended by other tests to simplify them and make the code more reusable.

Code

function createNode(array $options = array()) {

  // Create a node.
  $this
    ->drupalGet('node/add/page');
  $this
    ->assertResponse(200);
  $langcode = LANGUAGE_NONE;
  $edit = array(
    'title' => $this
      ->randomName(8),
    "body[{$langcode}][0][value]" => $this
      ->randomName(16),
  ) + $options;
  $this
    ->drupalPost(NULL, $edit, t('Save'));
  return $this
    ->drupalGetNodeByTitle($edit['title']);
}