Exemplo n.º 1
0
 /**
  * Draw the progress bar.
  * Prints the progress-bar to the screen. If start() has not been called 
  * yet, the current line is used for {@link ezcConsolProgressbar::start()}.
  *
  * @return void
  */
 public function output()
 {
     if ($this->options->minVerbosity > $this->output->options->verbosityLevel || $this->options->maxVerbosity !== false && $this->options->maxVerbosity < $this->output->options->verbosityLevel) {
         // Do not print progress bar if verbosity level is lower than it's
         // output objects value.
         return;
     }
     if ($this->started === false) {
         $this->start();
     }
     $this->output->restorePos();
     if (ezcBaseFeatures::os() === "Windows") {
         echo str_repeat("", $this->options->width);
     }
     $this->generateValues();
     echo $this->insertValues();
 }
Exemplo n.º 2
0
 public function testRestorePosFailure()
 {
     $output = new ezcConsoleOutput();
     try {
         $output->restorePos();
     } catch (ezcConsoleNoPositionStoredException $e) {
         return;
     }
     $this->fail("Exception not thrown on restore position without stored position.");
 }
Exemplo n.º 3
0
 public function testRestorePosFailure()
 {
     if (ezcBaseFeatures::os() === 'Windows') {
         $this->markTestSkipped("Does not work on Windows");
     }
     $output = new ezcConsoleOutput();
     try {
         $output->restorePos();
     } catch (ezcConsoleNoPositionStoredException $e) {
         return;
     }
     $this->fail("Exception not thrown on restore position without stored position.");
 }