public function testMultiRowIndexFile() {
$iteration = 3;
for ($i = 0; $i < $iteration; $i++) {
$profile = new Profile('token' . $i);
$profile
->setIp('127.0.0.' . $i);
$profile
->setUrl('http://foo.bar/' . $i);
$storage = $this
->getStorage();
$storage
->write($profile);
$storage
->write($profile);
$storage
->write($profile);
}
$handle = fopen(self::$tmpDir . '/index.csv', 'r');
for ($i = 0; $i < $iteration; $i++) {
$row = fgetcsv($handle);
$this
->assertEquals('token' . $i, $row[0]);
$this
->assertEquals('127.0.0.' . $i, $row[1]);
$this
->assertEquals('http://foo.bar/' . $i, $row[3]);
}
$this
->assertFalse(fgetcsv($handle));
}