View source
<?php
require_once drupal_get_path('module', 'og') . '/tests/og_testcase.php';
class OgPost extends OgTestCase {
public static function getInfo() {
return array(
'name' => t('Organic groups posting test'),
'description' => t('Tests posting a group post into a group node.'),
'group' => t('Organic groups'),
);
}
function setUp() {
parent::setUp('og', 'og_access');
$web_admin = $this
->drupalCreateUser(array(
'administer nodes',
'administer content types',
'access administration pages',
'administer site configuration',
'administer organic groups',
));
$this
->drupalLogin($web_admin);
}
function testOgPost() {
$og_group_type = $this
->drupalCreateContentType();
variable_set('og_content_type_usage_' . $og_group_type->name, 'group');
$og_post_type = $this
->drupalCreateContentType();
variable_set('og_content_type_usage_' . $og_post_type->name, 'group_post_standard');
menu_rebuild();
$gid = $this
->addOgGroup($og_group_type->name);
$this
->addOgPost($og_post_type->name, array(
$gid,
));
}
}