Security update for permissions_by_term
[yaffs-website] / vendor / behat / behat / src / Behat / Behat / Hook / Scope / BeforeStepScope.php
1 <?php
2
3 /*
4  * This file is part of the Behat.
5  * (c) Konstantin Kudryashov <ever.zet@gmail.com>
6  *
7  * For the full copyright and license information, please view the LICENSE
8  * file that was distributed with this source code.
9  */
10
11 namespace Behat\Behat\Hook\Scope;
12
13 use Behat\Gherkin\Node\FeatureNode;
14 use Behat\Gherkin\Node\StepNode;
15 use Behat\Testwork\Environment\Environment;
16 use Behat\Testwork\Suite\Suite;
17
18 /**
19  * Represents a BeforeStep hook scope.
20  *
21  * @author Konstantin Kudryashov <ever.zet@gmail.com>
22  */
23 final class BeforeStepScope implements StepScope
24 {
25     /**
26      * @var Environment
27      */
28     private $environment;
29     /**
30      * @var FeatureNode
31      */
32     private $feature;
33     /**
34      * @var StepNode
35      */
36     private $step;
37
38     /**
39      * Initializes scope.
40      *
41      * @param Environment $env
42      * @param FeatureNode $feature
43      * @param StepNode    $step
44      */
45     public function __construct(Environment $env, FeatureNode $feature, StepNode $step)
46     {
47         $this->environment = $env;
48         $this->feature = $feature;
49         $this->step = $step;
50     }
51
52     /**
53      * Returns hook scope name.
54      *
55      * @return string
56      */
57     public function getName()
58     {
59         return self::BEFORE;
60     }
61
62     /**
63      * Returns hook suite.
64      *
65      * @return Suite
66      */
67     public function getSuite()
68     {
69         return $this->environment->getSuite();
70     }
71
72     /**
73      * Returns hook environment.
74      *
75      * @return Environment
76      */
77     public function getEnvironment()
78     {
79         return $this->environment;
80     }
81
82     /**
83      * Returns scope feature.
84      *
85      * @return FeatureNode
86      */
87     public function getFeature()
88     {
89         return $this->feature;
90     }
91
92     /**
93      * Returns scope step.
94      *
95      * @return StepNode
96      */
97     public function getStep()
98     {
99         return $this->step;
100     }
101 }