Пример #1
0
 /**
  * @param bool $short
  * @return string
  */
 protected function getRealAssertionString($short)
 {
     $assertionString = $this->getAssertionCount() . ' assertion' . ($this->getAssertionCount() == 1 ? '' : 's');
     $time = ', ' . $this->formatter->format($this->getSecondsElapsed(), $short);
     $remaining = $this->getRemainingTimeString($short);
     $counterString = $this->counter->render($this->getTestCount());
     $pad = $this->width - strlen($assertionString) - strlen($counterString) - strlen($time) - strlen($remaining);
     if ($pad <= 0) {
         return '';
     }
     return sprintf("%s%s%s%s%s\n", $assertionString, $time, $remaining, str_repeat(' ', $pad), $counterString);
 }
Пример #2
0
 public function testCanGetPercentage()
 {
     $counter = new ProgressCounter(5);
     $this->assert($counter->getPercentage(1))->equals(20);
 }