Security update for permissions_by_term
[yaffs-website] / vendor / behat / behat / src / Behat / Behat / Hook / Scope / AfterStepScope.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\Behat\Tester\Result\StepResult;
14 use Behat\Gherkin\Node\FeatureNode;
15 use Behat\Gherkin\Node\StepNode;
16 use Behat\Testwork\Environment\Environment;
17 use Behat\Testwork\Hook\Scope\AfterTestScope;
18 use Behat\Testwork\Suite\Suite;
19 use Behat\Testwork\Tester\Result\TestResult;
20
21 /**
22  * Represents an AfterStep hook scope.
23  *
24  * @author Konstantin Kudryashov <ever.zet@gmail.com>
25  */
26 final class AfterStepScope implements StepScope, AfterTestScope
27 {
28     /**
29      * @var Environment
30      */
31     private $environment;
32     /**
33      * @var FeatureNode
34      */
35     private $feature;
36     /**
37      * @var StepNode
38      */
39     private $step;
40     /**
41      * @var StepResult
42      */
43     private $result;
44
45     /**
46      * Initializes scope.
47      *
48      * @param Environment $env
49      * @param FeatureNode $feature
50      * @param StepNode    $step
51      * @param StepResult  $result
52      */
53     public function __construct(Environment $env, FeatureNode $feature, StepNode $step, StepResult $result)
54     {
55         $this->environment = $env;
56         $this->feature = $feature;
57         $this->step = $step;
58         $this->result = $result;
59     }
60
61     /**
62      * Returns hook scope name.
63      *
64      * @return string
65      */
66     public function getName()
67     {
68         return self::AFTER;
69     }
70
71     /**
72      * Returns hook suite.
73      *
74      * @return Suite
75      */
76     public function getSuite()
77     {
78         return $this->environment->getSuite();
79     }
80
81     /**
82      * Returns hook environment.
83      *
84      * @return Environment
85      */
86     public function getEnvironment()
87     {
88         return $this->environment;
89     }
90
91     /**
92      * Returns scope feature.
93      *
94      * @return FeatureNode
95      */
96     public function getFeature()
97     {
98         return $this->feature;
99     }
100
101     /**
102      * Returns scope step.
103      *
104      * @return StepNode
105      */
106     public function getStep()
107     {
108         return $this->step;
109     }
110
111     /**
112      * Returns test result.
113      *
114      * @return TestResult
115      */
116     public function getTestResult()
117     {
118         return $this->result;
119     }
120 }