Beispiel #1
0
 /**
  * Check If Scenario Or Outline Matches Specified Filter. 
  * 
  * @param   ScenarioNode|OutlineNode    $scenario   scenario or outline
  * @param   string                      $filter     filter string (optional)
  */
 public function isScenarioMatchFilter($scenario, $filter = null)
 {
     $feature = $scenario->getFeature();
     return $this->isClosuresMatchFilter(function ($tag) use($feature, $scenario) {
         return $scenario->hasTag($tag) || $feature->hasTag($tag);
     }, function ($tag) use($feature, $scenario) {
         return !$scenario->hasTag($tag) && !$feature->hasTag($tag);
     }, null !== $filter ? $filter : $this->filterString);
 }
Beispiel #2
0
 /**
  * Check If Scenario Or Outline Matches Specified Filter. 
  * 
  * @param   ScenarioNode|OutlineNode    $scenario   scenario or outline
  * @param   string                      $filter     filter string (optional)
  */
 public function isScenarioMatchFilter($scenario, $filter = null)
 {
     $filter = null !== $filter ? $filter : $this->filterString;
     $feature = $scenario->getFeature();
     if ('/' === $filter[0]) {
         return preg_match($filter, $scenario->getTitle()) || preg_match($filter, $feature->getTitle());
     }
     return false !== mb_strpos($scenario->getTitle(), $filter) || false !== mb_strpos($feature->getTitle(), $filter);
 }