X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FBehat%2FEventDispatcher%2FTester%2FEventDispatchingScenarioTester.php;fp=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FBehat%2FEventDispatcher%2FTester%2FEventDispatchingScenarioTester.php;h=0000000000000000000000000000000000000000;hp=44eb1312067093f3adb00aa69529a60911e2869d;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingScenarioTester.php b/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingScenarioTester.php deleted file mode 100644 index 44eb13120..000000000 --- a/vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingScenarioTester.php +++ /dev/null @@ -1,121 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Behat\EventDispatcher\Tester; - -use Behat\Behat\EventDispatcher\Event\AfterScenarioSetup; -use Behat\Behat\EventDispatcher\Event\AfterScenarioTested; -use Behat\Behat\EventDispatcher\Event\BeforeScenarioTeardown; -use Behat\Behat\EventDispatcher\Event\BeforeScenarioTested; -use Behat\Behat\Tester\ScenarioTester; -use Behat\Gherkin\Node\FeatureNode; -use Behat\Gherkin\Node\ScenarioInterface as Scenario; -use Behat\Testwork\Environment\Environment; -use Behat\Testwork\Tester\Result\TestResult; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; - -/** - * Scenario tester dispatching BEFORE/AFTER events during tests. - * - * @author Konstantin Kudryashov - */ -final class EventDispatchingScenarioTester implements ScenarioTester -{ - /** - * @var ScenarioTester - */ - private $baseTester; - /** - * @var EventDispatcherInterface - */ - private $eventDispatcher; - /** - * @var string - */ - private $beforeEventName; - /** - * @var string - */ - private $afterSetupEventName; - /** - * @var string - */ - private $beforeTeardownEventName; - /** - * @var string - */ - private $afterEventName; - - /** - * Initializes tester. - * - * @param ScenarioTester $baseTester - * @param EventDispatcherInterface $eventDispatcher - * @param string $beforeEventName - * @param string $afterSetupEventName - * @param string $beforeTeardownEventName - * @param string $afterEventName - */ - public function __construct( - ScenarioTester $baseTester, - EventDispatcherInterface $eventDispatcher, - $beforeEventName, - $afterSetupEventName, - $beforeTeardownEventName, - $afterEventName - ) { - $this->baseTester = $baseTester; - $this->eventDispatcher = $eventDispatcher; - $this->beforeEventName = $beforeEventName; - $this->afterSetupEventName = $afterSetupEventName; - $this->beforeTeardownEventName = $beforeTeardownEventName; - $this->afterEventName = $afterEventName; - } - - /** - * {@inheritdoc} - */ - public function setUp(Environment $env, FeatureNode $feature, Scenario $scenario, $skip) - { - $event = new BeforeScenarioTested($env, $feature, $scenario); - $this->eventDispatcher->dispatch($this->beforeEventName, $event); - - $setup = $this->baseTester->setUp($env, $feature, $scenario, $skip); - - $event = new AfterScenarioSetup($env, $feature, $scenario, $setup); - $this->eventDispatcher->dispatch($this->afterSetupEventName, $event); - - return $setup; - } - - /** - * {@inheritdoc} - */ - public function test(Environment $env, FeatureNode $feature, Scenario $scenario, $skip) - { - return $this->baseTester->test($env, $feature, $scenario, $skip); - } - - /** - * {@inheritdoc} - */ - public function tearDown(Environment $env, FeatureNode $feature, Scenario $scenario, $skip, TestResult $result) - { - $event = new BeforeScenarioTeardown($env, $feature, $scenario, $result); - $this->eventDispatcher->dispatch($this->beforeTeardownEventName, $event); - - $teardown = $this->baseTester->tearDown($env, $feature, $scenario, $skip, $result); - - $event = new AfterScenarioTested($env, $feature, $scenario, $result, $teardown); - $this->eventDispatcher->dispatch($this->afterEventName, $event); - - return $teardown; - } -}