You are here

function OgPost::testOgPost in Organic groups 6

Same name and namespace in other branches
  1. 5.8 tests/og_post.test \OgPost::testOgPost()
  2. 5 tests/og_post.test \OgPost::testOgPost()
  3. 5.2 tests/og_post.test \OgPost::testOgPost()
  4. 5.3 tests/og_post.test \OgPost::testOgPost()
  5. 5.7 tests/og_post.test \OgPost::testOgPost()
  6. 6.2 tests/og.post.test \OgPost::testOgPost()

Test the simple case of creation of a group node and a group post by the same user.

File

tests/og.post.test, line 37

Class

OgPost

Code

function testOgPost() {

  // Create a group node content type.
  $og_group_type = $this
    ->drupalCreateContentType();
  variable_set('og_content_type_usage_' . $og_group_type->name, 'group');

  // Create a group post content type.
  $og_post_type = $this
    ->drupalCreateContentType();
  variable_set('og_content_type_usage_' . $og_post_type->name, 'group_post_standard');

  // Rebuild the menu so the new content types will appear in the menu.
  menu_rebuild();

  // Create a group node.
  $gid = $this
    ->addOgGroup($og_group_type->name);

  // Create a post node.
  $this
    ->addOgPost($og_post_type->name, array(
    $gid,
  ));
}