public function testPaginate()
{
$input = new ArrayInput([], $this->command->getDefinition());
$output = $this->output;
$this->application->setTerminalDimensions(100, 14);
$this->characterReader->read()->willReturn('')->shouldBeCalledTimes(1);
$this->driver->history()->willReturn($this->history->reveal());
$this->history->rewind()->shouldBeCalled();
$this->history->valid()->willReturn(true, true, true, false);
$this->history->key()->willReturn(0, 1, 2);
$this->history->next()->shouldBeCalled();
$this->history->current()->willReturn($this->createHistoryEntry(1), $this->createHistoryEntry(2), $this->createHistoryEntry(3));
$this->command->execute($input, $this->output);
$output = $this->output->fetch();
$expected = <<<'EOT'
run 1
Date: 2016-01-01T00:00:00+01:00
Branch: branch1
Context: foo
Scale: 10 subjects, 20 iterations, 40 revolutions
Summary: (best [mean] worst) = 0.500 [1.250] 2.000 (s)
⅀T: 100 μRSD/r: 0.750%
run 2
Date: 2016-01-01T00:00:00+01:00
Branch: branch2
Context: foo
Scale: 10 subjects, 20 iterations, 40 revolutions
lines 0-13 any key to continue, <q> to quit
run 3
Date: 2016-01-01T00:00:00+01:00
Branch: branch3
Context: foo
Scale: 10 subjects, 20 iterations, 40 revolutions
Summary: (best [mean] worst) = 0.500 [1.250] 2.000 (s)
⅀T: 100 μRSD/r: 0.750%
EOT;
$this->assertEquals($this->replaceDate($expected), $this->replaceDate($output));
}