You are here

public function ProcessorWebTest::testMappingCid in Feeds Comment Processor 7

Tests importing existing cids.

File

src/Tests/ProcessorWebTest.php, line 140
Contains \Drupal\feeds_comment_processor\Tests\ProcessorWebTest.

Class

ProcessorWebTest
Basic behavior tests for feeds_comment_processor.

Namespace

Drupal\feeds_comment_processor\Tests

Code

public function testMappingCid() {

  // // Adding a mapping to the user_name will invoke authorization.
  $this
    ->addMappings('comment', array(
    5 => array(
      'source' => 'guid',
      'target' => 'cid',
    ),
  ));
  $url = $GLOBALS['base_url'] . '/' . drupal_get_path('module', 'feeds_comment_processor') . '/tests/test.csv';
  $nid = $this
    ->createFeedNode('comment', $url, 'Comment test');
  $this
    ->assertText('Created 1 comment.');
  $this
    ->assertEqual(1, db_query("SELECT COUNT(*) FROM {comment}")
    ->fetchField());
  $comment = comment_load(10);
  $this
    ->assertEqual(10, $comment->cid);
  $this
    ->assertEqual(1, $comment->nid);
  $this
    ->assertEqual('01/', $comment->thread);
}