if ($this->pos == 0) {
return array_pop($buffer);
}
+ if (is_null($buffer)) {
+ return null;
+ }
if (count($buffer) > 1) {
return array_pop($buffer);
}
$pls = iterator_to_array($this->pli, false);
self::assertCount(0, $pls);
}
+
+ public function testEmptyLogFile()
+ {
+ $logfile = dirname(__DIR__) . '/../../datasets/log/empty.friendica.log.txt';
+
+ $reader = new ReversedFileReader();
+ $pli = new ParsedLogIterator($reader);
+ $pli->open($logfile);
+
+ $pls = iterator_to_array($pli, false);
+ self::assertCount(0, $pls);
+ }
}