Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function printHeader(Formatter $formatter, FeatureNode $feature, Scenario $scenario)
 {
     if ($scenario instanceof TaggedNodeInterface) {
         $this->printTags($formatter->getOutputPrinter(), $scenario->getTags());
     }
     $this->printKeyword($formatter->getOutputPrinter(), $scenario->getKeyword());
     $this->printTitle($formatter->getOutputPrinter(), $scenario->getTitle());
     $this->pathPrinter->printScenarioPath($formatter, $feature, $scenario, mb_strlen($this->indentText, 'utf8'));
     $this->printDescription($formatter->getOutputPrinter(), $scenario->getTitle());
 }
Exemplo n.º 2
0
 /**
  * Calculates scenario header width.
  *
  * @param Scenario $scenario
  * @param integer  $indentation
  *
  * @return integer
  */
 public function calculateScenarioHeaderWidth(Scenario $scenario, $indentation)
 {
     $indentText = str_repeat(' ', intval($indentation));
     if ($scenario instanceof ExampleNode) {
         $header = sprintf('%s%s', $indentText, $scenario->getTitle());
     } else {
         $title = $scenario->getTitle();
         $lines = explode("\n", $title);
         $header = sprintf('%s%s: %s', $indentText, $scenario->getKeyword(), array_shift($lines));
     }
     return mb_strlen(rtrim($header), 'utf8');
 }