You are here

protected function ParserCSVTest::_testSimple in Feeds 6

Same name and namespace in other branches
  1. 7.2 tests/parser_csv.test \ParserCSVTest::_testSimple()
  2. 7 tests/parser_csv.test \ParserCSVTest::_testSimple()

Simple test of parsing functionality.

1 call to ParserCSVTest::_testSimple()
ParserCSVTest::test in tests/parser_csv.test
Test method.

File

tests/parser_csv.test, line 39
Tests for ParserCSV library.

Class

ParserCSVTest
Test aggregating a feed as node items.

Code

protected function _testSimple() {
  $file = $this
    ->absolutePath() . '/tests/feeds/nodes.csv';
  include $this
    ->absolutePath() . '/tests/feeds/nodes.csv.php';
  $iterator = new ParserCSVIterator($file);
  $parser = new ParserCSV();
  $parser
    ->setDelimiter(',');
  $rows = $parser
    ->parse($iterator);
  $this
    ->assertFalse($parser
    ->lastLinePos(), t('Parser reports all lines parsed'));
  $this
    ->assertEqual(md5(serialize($rows)), md5(serialize($control_result)), t('Parsed result matches control result.'));
}