Merge pull request #136 from BiffBangPow/pulls/base-scenario-outlines

Replaced all references to ScenarioEvent with BaseScenarioEvent…
This commit is contained in:
Daniel Hensby 2016-12-13 11:04:29 +00:00 committed by GitHub
commit 8bb5ff5a1f
4 changed files with 72 additions and 72 deletions

View File

@ -7,9 +7,9 @@ use Behat\Behat\Context\ClosuredContextInterface,
Behat\Behat\Context\BehatContext, Behat\Behat\Context\BehatContext,
Behat\Behat\Context\Step, Behat\Behat\Context\Step,
Behat\Behat\Event\StepEvent, Behat\Behat\Event\StepEvent,
Behat\Behat\Event\ScenarioEvent,
Behat\Behat\Exception\PendingException; Behat\Behat\Exception\PendingException;
use Behat\Behat\Event\BaseScenarioEvent;
use Behat\Mink\Driver\Selenium2Driver; use Behat\Mink\Driver\Selenium2Driver;
use Behat\Gherkin\Node\PyStringNode, use Behat\Gherkin\Node\PyStringNode,
@ -241,7 +241,7 @@ JS;
* *
* @AfterScenario * @AfterScenario
*/ */
public function closeModalDialog(ScenarioEvent $event) { public function closeModalDialog(BaseScenarioEvent $event) {
try{ try{
// Only for failed tests on CMS page // Only for failed tests on CMS page
if (4 === $event->getResult()) { if (4 === $event->getResult()) {
@ -266,7 +266,7 @@ JS;
* *
* @AfterScenario @assets * @AfterScenario @assets
*/ */
public function cleanAssetsAfterScenario(ScenarioEvent $event) { public function cleanAssetsAfterScenario(BaseScenarioEvent $event) {
foreach(\File::get() as $file) { foreach(\File::get() as $file) {
if(file_exists($file->getFullPath())) $file->delete(); if(file_exists($file->getFullPath())) $file->delete();
} }

View File

@ -7,8 +7,8 @@ Behat\Behat\Context\TranslatedContextInterface,
Behat\Behat\Context\BehatContext, Behat\Behat\Context\BehatContext,
Behat\Behat\Context\Step, Behat\Behat\Context\Step,
Behat\Behat\Event\FeatureEvent, Behat\Behat\Event\FeatureEvent,
Behat\Behat\Event\ScenarioEvent,
Behat\Behat\Exception\PendingException; Behat\Behat\Exception\PendingException;
use Behat\Behat\Event\BaseScenarioEvent;
use Behat\Gherkin\Node\PyStringNode, use Behat\Gherkin\Node\PyStringNode,
Behat\Gherkin\Node\TableNode; Behat\Gherkin\Node\TableNode;
use Symfony\Component\DomCrawler\Crawler; use Symfony\Component\DomCrawler\Crawler;
@ -54,7 +54,7 @@ class EmailContext extends BehatContext
/** /**
* @BeforeScenario * @BeforeScenario
*/ */
public function before(ScenarioEvent $event) public function before(BaseScenarioEvent $event)
{ {
// Also set through the 'supportbehat' extension // Also set through the 'supportbehat' extension
// to ensure its available both in CLI execution and the tested browser session // to ensure its available both in CLI execution and the tested browser session

View File

@ -8,11 +8,11 @@ use Behat\Behat\Context\ClosuredContextInterface,
Behat\Behat\Context\Step, Behat\Behat\Context\Step,
Behat\Behat\Event\StepEvent, Behat\Behat\Event\StepEvent,
Behat\Behat\Event\FeatureEvent, Behat\Behat\Event\FeatureEvent,
Behat\Behat\Event\ScenarioEvent,
Behat\Behat\Exception\PendingException, Behat\Behat\Exception\PendingException,
Behat\Mink\Driver\Selenium2Driver, Behat\Mink\Driver\Selenium2Driver,
Behat\Gherkin\Node\PyStringNode, Behat\Gherkin\Node\PyStringNode,
Behat\Gherkin\Node\TableNode; Behat\Gherkin\Node\TableNode;
use Behat\Behat\Event\BaseScenarioEvent;
// PHPUnit // PHPUnit
require_once 'PHPUnit/Autoload.php'; require_once 'PHPUnit/Autoload.php';
@ -84,7 +84,7 @@ class FixtureContext extends BehatContext
/** /**
* @BeforeScenario @database-defaults * @BeforeScenario @database-defaults
*/ */
public function beforeDatabaseDefaults(ScenarioEvent $event) { public function beforeDatabaseDefaults(BaseScenarioEvent $event) {
\SapphireTest::empty_temp_db(); \SapphireTest::empty_temp_db();
\DB::getConn()->quiet(); \DB::getConn()->quiet();
$dataClasses = \ClassInfo::subclassesFor('DataObject'); $dataClasses = \ClassInfo::subclassesFor('DataObject');
@ -97,14 +97,14 @@ class FixtureContext extends BehatContext
/** /**
* @AfterScenario * @AfterScenario
*/ */
public function afterResetDatabase(ScenarioEvent $event) { public function afterResetDatabase(BaseScenarioEvent $event) {
\SapphireTest::empty_temp_db(); \SapphireTest::empty_temp_db();
} }
/** /**
* @AfterScenario * @AfterScenario
*/ */
public function afterResetAssets(ScenarioEvent $event) { public function afterResetAssets(BaseScenarioEvent $event) {
if (is_array($this->createdFilesPaths)) { if (is_array($this->createdFilesPaths)) {
$createdFiles = array_reverse($this->createdFilesPaths); $createdFiles = array_reverse($this->createdFilesPaths);
foreach ($createdFiles as $path) { foreach ($createdFiles as $path) {

View File

@ -4,8 +4,8 @@ namespace SilverStripe\BehatExtension\Context;
use Behat\Behat\Context\Step, use Behat\Behat\Context\Step,
Behat\Behat\Event\FeatureEvent, Behat\Behat\Event\FeatureEvent,
Behat\Behat\Event\ScenarioEvent,
Behat\Behat\Event\SuiteEvent; Behat\Behat\Event\SuiteEvent;
use Behat\Behat\Event\BaseScenarioEvent;
use Behat\Gherkin\Node\PyStringNode; use Behat\Gherkin\Node\PyStringNode;
use Behat\MinkExtension\Context\MinkContext; use Behat\MinkExtension\Context\MinkContext;
use Behat\Mink\Driver\GoutteDriver, use Behat\Mink\Driver\GoutteDriver,
@ -183,7 +183,7 @@ class SilverStripeContext extends MinkContext implements SilverStripeAwareContex
/** /**
* @BeforeScenario * @BeforeScenario
*/ */
public function before(ScenarioEvent $event) { public function before(BaseScenarioEvent $event) {
if (!isset($this->databaseName)) { if (!isset($this->databaseName)) {
throw new \LogicException( throw new \LogicException(
'Context\'s $databaseName has to be set when implementing SilverStripeAwareContextInterface.' 'Context\'s $databaseName has to be set when implementing SilverStripeAwareContextInterface.'