public function FeedsExLineIteratorUnitTests::testLineLimit in Feeds extensible parsers 7.2
Tests settings line limits.
File
- src/
Tests/ FeedsExUnitTests.test, line 210 - Contains unit tests for feeds_ex.
Class
- FeedsExLineIteratorUnitTests
- Reading a line from a file.
Code
public function testLineLimit() {
foreach (range(1, 4) as $limit) {
$iterator = new FeedsExLineIterator($this->moduleDir . '/tests/resources/test.jsonl');
$iterator
->setLineLimit($limit);
$array = iterator_to_array($iterator);
$this
->assertEqual(count($array), $limit, format_string('@count lines read.', array(
'@count' => count($array),
)));
}
}