You are here

public function ActivityWebTest::testCommentActivityLoadObjects in Activity 7

File

tests/activity_unit.test, line 109

Class

ActivityWebTest

Code

public function testCommentActivityLoadObjects() {
  $handler = activity_load_handler('comment_insert');
  $current_user = $this
    ->drupalCreateUser();
  $this
    ->drupalLogin($current_user);
  $handler->options = array(
    'types' => array(),
    'view_modes' => array(),
  );
  $handler->actions_id = -1;
  $handler->label = 'Test comment insert';
  $node1 = $this
    ->drupalCreateNode(array(
    'type' => 'article',
  ));
  $cid = $this
    ->postComment($node1, 'test comment');
  $objects1 = $handler
    ->loadObjects($cid);

  // Make sure loaded objects match what is expected.
  $this
    ->assertEqual($cid, $objects1['comment']->cid, t('Loaded up the correct comment'));
  $this
    ->assertEqual($node1->nid, $objects1['node']->nid, t('Loaded up correct node'));
}