Пример #1
0
 /**
  * Checks if scenario or outline matches specified filter.
  *
  * @param ScenarioNode $scenario Scenario or Outline node instance
  *
  * @return Boolean
  */
 public function isScenarioMatch(ScenarioNode $scenario)
 {
     if ($this->filterLine === $scenario->getLine()) {
         return true;
     }
     if ($scenario instanceof OutlineNode && $scenario->hasExamples()) {
         return $this->filterLine === $scenario->getLine() || in_array($this->filterLine, $scenario->getExamples()->getRowLines());
     }
     return false;
 }
Пример #2
0
 /**
  * Checks if scenario or outline matches specified filter.
  *
  * @param ScenarioNode $scenario Scenario or Outline node instance
  *
  * @return Boolean
  */
 public function isScenarioMatch(ScenarioNode $scenario)
 {
     if ($this->filterMinLine <= $scenario->getLine() && $this->filterMaxLine >= $scenario->getLine()) {
         return true;
     }
     if ($scenario instanceof OutlineNode && $scenario->hasExamples()) {
         foreach ($scenario->getExamples()->getRowLines() as $line) {
             if ($line >= $this->filterMinLine && $line <= $this->filterMaxLine) {
                 return true;
             }
         }
     }
     return false;
 }
Пример #3
0
 /**
  * Dumps scenario.
  *
  * @param ScenarioNode $scenario Scenario instance
  *
  * @return string
  */
 public function dumpScenario(ScenarioNode $scenario)
 {
     $keyWordToUse = $scenario instanceof OutlineNode ? $this->keywords->getOutlineKeywords() : $this->keywords->getScenarioKeywords();
     $content = '' . (sizeof($scenario->getTags()) > 0 ? PHP_EOL . $this->dumpTags($scenario->getTags(), 1) : '') . PHP_EOL . $this->dumpKeyword($keyWordToUse, $scenario->getTitle(), 1);
     foreach ($scenario->getSteps() as $step) {
         $content .= PHP_EOL . $this->dumpIndent(2) . $this->dumpStep($step);
     }
     if ($scenario instanceof OutlineNode) {
         $content .= '' . PHP_EOL . PHP_EOL . $this->dumpKeyword($this->keywords->getExamplesKeywords(), '', 1);
         $examples = $scenario->getExamples();
         $content .= $this->dumpTableNode($examples, 2);
     }
     return $content;
 }