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