X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FBehat%2FHook%2FCall%2FRuntimeStepHook.php;fp=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FBehat%2FHook%2FCall%2FRuntimeStepHook.php;h=0000000000000000000000000000000000000000;hp=a1326c3cfc76fce7ecd8f38b0aa587ae274902b4;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/behat/behat/src/Behat/Behat/Hook/Call/RuntimeStepHook.php b/vendor/behat/behat/src/Behat/Behat/Hook/Call/RuntimeStepHook.php deleted file mode 100644 index a1326c3cf..000000000 --- a/vendor/behat/behat/src/Behat/Behat/Hook/Call/RuntimeStepHook.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Behat\Hook\Call; - -use Behat\Behat\Hook\Scope\StepScope; -use Behat\Gherkin\Filter\NameFilter; -use Behat\Gherkin\Node\StepNode; -use Behat\Testwork\Hook\Call\RuntimeFilterableHook; -use Behat\Testwork\Hook\Scope\HookScope; - -/** - * Represents a step hook. - * - * @author Konstantin Kudryashov - */ -abstract class RuntimeStepHook extends RuntimeFilterableHook -{ - /** - * {@inheritdoc} - */ - public function filterMatches(HookScope $scope) - { - if (!$scope instanceof StepScope) { - return false; - } - - if (null === ($filterString = $this->getFilterString())) { - return true; - } - - if (!empty($filterString)) { - $filter = new NameFilter($filterString); - - if ($filter->isFeatureMatch($scope->getFeature())) { - return true; - } - - return $this->isStepMatch($scope->getStep(), $filterString); - } - - return false; - } - - /** - * Checks if Feature matches specified filter. - * - * @param StepNode $step - * @param string $filterString - * - * @return Boolean - */ - private function isStepMatch(StepNode $step, $filterString) - { - if ('/' === $filterString[0]) { - return 1 === preg_match($filterString, $step->getText()); - } - - return false !== mb_strpos($step->getText(), $filterString, 0, 'utf8'); - } -}