/**
  *
  */
 public function testProgressWith1000ItemsAndCustomtRedrawRate()
 {
     $output = m::mock('mako\\cli\\output\\Output');
     $output->shouldReceive('write')->times(1002);
     $progressBar = new ProgressBar($output, 1000, 1);
     $progressBar->draw();
     for ($i = 0; $i < 1000; $i++) {
         $progressBar->advance();
     }
 }
示例#2
0
 /**
  * Draws a progress bar and returns a progress bar instance.
  *
  * @access  protected
  * @param   int                                  $items       Total number of items
  * @param   int                                  $redrawRate  Redraw rate
  * @return  \mako\cli\output\helpers\ProgessBar
  */
 protected function progressBar($items, $redrawRate = null)
 {
     $progressBar = new ProgressBar($this->output, $items, $redrawRate);
     $progressBar->setEmptyTemplate('<red>-</red>');
     $progressBar->setFilledTemplate('<green>=</green>');
     $progressBar->draw();
     return $progressBar;
 }