function OgTestCase::addOg in Organic groups 5.2
Same name and namespace in other branches
- 5.8 tests/og_testcase.php \OgTestCase::addOg()
- 5 tests/og_testcase.php \OgTestCase::addOg()
- 5.3 tests/og_testcase.php \OgTestCase::addOg()
- 5.7 tests/og_testcase.php \OgTestCase::addOg()
2 calls to OgTestCase::addOg()
- OgPost::testOgPost in tests/
og_post.test - OgSubscribe::testAddOg in tests/
og_subscribe.test
File
- tests/
og_testcase.php, line 6
Class
Code
function addOg($type, $selective = OG_OPEN) {
$edit = array();
$edit['title'] = '!SimpleTest test group node! ' . $this
->randomName(10);
$edit['og_description'] = '!SimpleTest og description' . $this
->randomName(10);
$edit['body'] = '!SimpleTest test group welcome message! ' . $this
->randomName(32) . ' ' . $this
->randomName(32);
$edit['og_selective'] = (string) $selective;
// $this->_browser->setFieldByName('edit[og_theme]', ''); // May not be present, so no error catching
$this
->drupalPostRequest("node/add/{$type}", $edit, 'Submit');
$this
->assertWantedRaw(t('Your %post has been created.', array(
'%post' => $type,
)), 'Group created');
$node = node_load(array(
'title' => $edit['title'],
));
$this
->assertNotNull($node, 'Group found in database. %s');
$this->_cleanupGroups[] = $node->nid;
return $node->nid;
}