You are here

public function FeedsOgTest::testImportOgReferenceWithoutAuthorizing in Feeds 7.2

Tests importing content for a group using the web UI.

File

tests/feeds_og.test, line 134
Contains FeedsOgTest.

Class

FeedsOgTest
Tests for Organic Groups integration.

Code

public function testImportOgReferenceWithoutAuthorizing() {
  list($group1, $group2) = $this
    ->setUpStuffForTestingOgReferenceWithoutAuthorizing();

  // And perform import.
  $this
    ->drupalPost('node/3/import', NULL, 'Import');
  $this
    ->assertText('Created 2 nodes');

  // Assert that both nodes were created.
  $this
    ->assertNodeCount(5);
  $node1 = node_load(4);
  $this
    ->assertEqual('Lorem ipsum', $node1->title);
  $this
    ->assertEqual($group1->nid, $node1->og_group_ref[LANGUAGE_NONE][0]['target_id']);
  $node2 = node_load(5);
  $this
    ->assertEqual('Ut wisi enim ad minim veniam', $node2->title);
  $this
    ->assertEqual($group2->nid, $node2->og_group_ref[LANGUAGE_NONE][0]['target_id']);
}