You are here

protected function OpignoSimpleUIOGTest::_createOGNode in Opigno 7.0

Create an OG node

1 call to OpignoSimpleUIOGTest::_createOGNode()
OpignoSimpleUIOGTest::testOGNodeUrls in modules/opigno_simple_ui/tests/opigno_simple_ui.og.test
Simple UI overrides several URLs to more user-friendly, logical items. For example, an OG node will have a "Members" tab, and underneath that an "Add members" sub tab. However, the "Group" tab is removed.

File

modules/opigno_simple_ui/tests/opigno_simple_ui.og.test, line 108
Check OG overrides.

Class

OpignoSimpleUIOGTest
@file Check OG overrides.

Code

protected function _createOGNode() {
  $this
    ->drupalGet('node/add/og');

  // Check that Group field is on by default and hiddent
  $this
    ->assertNoFieldById('edit-group-group-und', '', 'Group checkbox is hidden.');
  $edit = array(
    'title' => $this
      ->randomName(8),
    'body[' . LANGUAGE_NONE . '][0][value]' => $this
      ->randomName(8),
  );
  $this
    ->drupalPost($this
    ->getURL(), $edit, 'Save');
  $matches = array();
  preg_match('/node\\/([0-9]+)$/', $this
    ->getURL(), $matches);
  $node = node_load($matches[1]);
  return $node->group_group[LANGUAGE_NONE][0]['value'];
}