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