X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FBehat%2FGherkin%2FCli%2FFilterController.php;fp=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FBehat%2FGherkin%2FCli%2FFilterController.php;h=0000000000000000000000000000000000000000;hp=7f13989f182e33c253bbb0c7abad99f8cc0f62e4;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/behat/behat/src/Behat/Behat/Gherkin/Cli/FilterController.php b/vendor/behat/behat/src/Behat/Behat/Gherkin/Cli/FilterController.php deleted file mode 100644 index 7f13989f1..000000000 --- a/vendor/behat/behat/src/Behat/Behat/Gherkin/Cli/FilterController.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Behat\Gherkin\Cli; - -use Behat\Gherkin\Filter\NameFilter; -use Behat\Gherkin\Filter\RoleFilter; -use Behat\Gherkin\Filter\TagFilter; -use Behat\Gherkin\Gherkin; -use Behat\Testwork\Cli\Controller; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Configures default Gherkin filters. - * - * @author Konstantin Kudryashov - */ -final class FilterController implements Controller -{ - /** - * @var Gherkin - */ - private $gherkin; - - /** - * Initializes controller. - * - * @param Gherkin $gherkin - */ - public function __construct(Gherkin $gherkin) - { - $this->gherkin = $gherkin; - } - - /** - * Configures command to be executable by the controller. - * - * @param Command $command - */ - public function configure(Command $command) - { - $command - ->addOption( - '--name', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, - "Only executeCall the feature elements which match part" . PHP_EOL . - "of the given name or regex." - ) - ->addOption( - '--tags', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, - "Only executeCall the features or scenarios with tags" . PHP_EOL . - "matching tag filter expression." - ) - ->addOption( - '--role', null, InputOption::VALUE_REQUIRED, - "Only executeCall the features with actor role matching" . PHP_EOL . - "a wildcard." - ); - } - - /** - * Executes controller. - * - * @param InputInterface $input - * @param OutputInterface $output - * - * @return null|integer - */ - public function execute(InputInterface $input, OutputInterface $output) - { - $filters = array(); - - foreach ($input->getOption('name') as $name) { - $filters[] = new NameFilter($name); - } - - foreach ($input->getOption('tags') as $tags) { - $filters[] = new TagFilter($tags); - } - - if ($role = $input->getOption('role')) { - $filters[] = new RoleFilter($role); - } - - if (count($filters)) { - $this->gherkin->setFilters($filters); - } - } -}