You are here

protected function FeedsWebTestCase::changeNodeAuthor in Feeds 7.2

Changes the author of a node and asserts the change in the UI.

Parameters

int $nid: The ID of the node to change author.

object $account: The new author.

6 calls to FeedsWebTestCase::changeNodeAuthor()
FeedsAccountSwitcherTest::testAuthorizedImport in tests/FeedsAccountSwitcherTest.test
Tests if an extra account switch happens on authorized imports.
FeedsAccountSwitcherTest::testFailingImport in tests/FeedsAccountSwitcherTest.test
Tests if the user is switched back properly when an import fails.
FeedsAccountSwitcherTest::testRunImportAsFeedNodeAuthorInUI in tests/FeedsAccountSwitcherTest.test
Tests if the import is ran as the feed node author when using the UI.
FeedsAccountSwitcherTest::testRunImportAsFeedNodeAuthorOnCron in tests/FeedsAccountSwitcherTest.test
Tests if the import is ran as the feed node author when using cron.
FeedsOgTest::setUpStuffForTestingOgReferenceWithoutAuthorizing in tests/feeds_og.test
Sets up stuff for testing with the authorize option turned off.

... See full list

File

tests/feeds.test, line 679
Common functionality for all Feeds tests.

Class

FeedsWebTestCase
Test basic Data API functionality.

Code

protected function changeNodeAuthor($nid, $account) {
  $node = node_load($nid);
  $node->uid = $account->uid;
  node_save($node);

  // Assert that author was in fact changed.
  $this
    ->drupalGet('node/' . $nid);
  $this
    ->assertText($account->name);
}