Security update for permissions_by_term
[yaffs-website] / vendor / behat / behat / src / Behat / Behat / EventDispatcher / Event / BeforeBackgroundTeardown.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\EventDispatcher\Event;
12
13 use Behat\Gherkin\Node\BackgroundNode;
14 use Behat\Gherkin\Node\FeatureNode;
15 use Behat\Gherkin\Node\ScenarioInterface;
16 use Behat\Testwork\Environment\Environment;
17 use Behat\Testwork\EventDispatcher\Event\BeforeTeardown;
18 use Behat\Testwork\Tester\Result\TestResult;
19
20 /**
21  * Represents an event right before background teardown.
22  *
23  * @author Konstantin Kudryashov <ever.zet@gmail.com>
24  */
25 final class BeforeBackgroundTeardown extends BackgroundTested implements BeforeTeardown
26 {
27     /**
28      * @var FeatureNode
29      */
30     private $feature;
31     /**
32      * @var BackgroundNode
33      */
34     private $background;
35     /**
36      * @var TestResult
37      */
38     private $result;
39
40     /**
41      * Initializes event.
42      *
43      * @param Environment    $env
44      * @param FeatureNode    $feature
45      * @param BackgroundNode $background
46      * @param TestResult     $result
47      */
48     public function __construct(
49         Environment $env,
50         FeatureNode $feature,
51         BackgroundNode $background,
52         TestResult $result
53     ) {
54         parent::__construct($env);
55
56         $this->feature = $feature;
57         $this->background = $background;
58         $this->result = $result;
59     }
60
61     /**
62      * Returns feature.
63      *
64      * @return FeatureNode
65      */
66     public function getFeature()
67     {
68         return $this->feature;
69     }
70
71     /**
72      * Returns scenario node.
73      *
74      * @return ScenarioInterface
75      */
76     public function getScenario()
77     {
78         return $this->background;
79     }
80
81     /**
82      * Returns background node.
83      *
84      * @return BackgroundNode
85      */
86     public function getBackground()
87     {
88         return $this->background;
89     }
90
91     /**
92      * Returns current test result.
93      *
94      * @return TestResult
95      */
96     public function getTestResult()
97     {
98         return $this->result;
99     }
100 }