You are here

public function ProcessorWebTest::test in Feeds Comment Processor 7

Tests a very basic import.

File

src/Tests/ProcessorWebTest.php, line 83
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 test() {
  $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');
  $comment = comment_load(1);
  $this
    ->assertEqual(1, $comment->nid);
  $this
    ->assertEqual('test subject', $comment->subject);
  $this
    ->assertEqual('example.com', $comment->hostname);
  $this
    ->assertEqual('test body text', $comment->comment_body[LANGUAGE_NONE][0]['value']);
  $this
    ->assertEqual('plain_text', $comment->comment_body[LANGUAGE_NONE][0]['format']);
}