f67f855c2a0454c67d405dff96b3de7f7165396f
[yaffs-website] / vendor / behat / behat / src / Behat / Behat / EventDispatcher / Event / BackgroundTested.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\NodeInterface;
15 use Behat\Testwork\EventDispatcher\Event\LifecycleEvent;
16
17 /**
18  * Represents a background event.
19  *
20  * @author Konstantin Kudryashov <ever.zet@gmail.com>
21  */
22 abstract class BackgroundTested extends LifecycleEvent implements ScenarioLikeTested
23 {
24     const BEFORE = 'tester.background_tested.before';
25     const AFTER_SETUP = 'tester.background_tested.after_setup';
26     const BEFORE_TEARDOWN = 'tester.background_tested.before_teardown';
27     const AFTER = 'tester.background_tested.after';
28
29     /**
30      * Returns background node.
31      *
32      * @return BackgroundNode
33      */
34     abstract public function getBackground();
35
36     /**
37      * Returns node.
38      *
39      * @return NodeInterface
40      */
41     final public function getNode()
42     {
43         return $this->getBackground();
44     }
45 }