4 * This file is part of the Behat.
5 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
11 namespace Behat\Behat\EventDispatcher\Event;
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\AfterTested;
18 use Behat\Testwork\Tester\Result\TestResult;
19 use Behat\Testwork\Tester\Setup\Teardown;
22 * Represents an event in which background was tested.
24 * @author Konstantin Kudryashov <ever.zet@gmail.com>
26 final class AfterBackgroundTested extends BackgroundTested implements AfterTested
48 * @param Environment $env
49 * @param FeatureNode $feature
50 * @param BackgroundNode $background
51 * @param TestResult $result
52 * @param Teardown $teardown
54 public function __construct(
57 BackgroundNode $background,
61 parent::__construct($env);
63 $this->feature = $feature;
64 $this->background = $background;
65 $this->result = $result;
66 $this->teardown = $teardown;
74 public function getFeature()
76 return $this->feature;
80 * Returns scenario node.
82 * @return ScenarioInterface
84 public function getScenario()
86 return $this->background;
90 * Returns background node.
92 * @return BackgroundNode
94 public function getBackground()
96 return $this->background;
100 * Returns current test result.
104 public function getTestResult()
106 return $this->result;
110 * Returns current test teardown.
114 public function getTeardown()
116 return $this->teardown;