/**
  * @depends testSeek
  */
 public function testValid(CsvReader $reader)
 {
     $this->assertTrue($reader->valid());
     $reader->seek($reader->count());
     $reader->next();
     $this->assertFalse($reader->valid());
     return $reader;
 }
 /**
  * {@inheritdoc}
  */
 public function count()
 {
     if (null === $this->count && $this->file) {
         $length = $this->length;
         $this->length = 0;
         $this->count = parent::count();
         $this->length = $length;
     }
     return $this->count ?: 0;
 }