Пример #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
 /**
  * @group #239
  * @dataProvider data
  */
 public function testFormattingShort($seconds, $_, $expected)
 {
     $this->assert($this->formatter->format($seconds, true))->equals($expected);
 }