public function testEndOfLine() { $totalItems = 70; $output = $this->getMock('Output', array('write', 'writeln')); $output->expects($this->exactly(60))->method('write')->with('<fg=green>.</fg=green>'); $output->expects($this->once())->method('writeln')->with(' 60|' . round(100 * 60 / $totalItems) . '% '); $fixture = new Progress($output, $totalItems); // every 60 progress calls, new line should be printed for ($i = 0; $i < 60; $i++) { $fixture->printProgress(); } }