Remove Behat-related code dependant on PHPUnit 3.x

We've upgraded SilverStripe core to PHPUnit 4.x now, and the Functions.php has moved locations.
Since all custom contexts either use one of these contexts, or extend off SilverStripeContext,
we can be certain that the required assertions are automatically included for custom contexts,
no need to duplicate the require_once() calls.

Note that Behat 3.x suggests using static methods on a class, e.g. PHPUnit_Framework_Assert::assertSame (see http://docs.behat.org/en/master/quick_intro.html).
This seems quite verbose, and increases the upgrade burden on any project using Behat.
This commit is contained in:
Ingo Schommer 2016-02-23 22:51:56 +13:00
parent 4010d987f9
commit 350392148f
6 changed files with 6 additions and 12 deletions

View File

@ -153,10 +153,6 @@ use SilverStripe\BehatExtension\Context\SilverStripeContext,
SilverStripe\Framework\Test\Behaviour\CmsUiContext,
SilverStripe\Cms\Test\Behaviour;
// PHPUnit
require_once 'PHPUnit/Autoload.php';
require_once 'PHPUnit/Framework/Assert/Functions.php';
/**
* Features context
*

View File

@ -13,8 +13,7 @@ use Behat\Gherkin\Node\PyStringNode,
Behat\Gherkin\Node\TableNode;
// PHPUnit
require_once 'PHPUnit/Autoload.php';
require_once 'PHPUnit/Framework/Assert/Functions.php';
require_once BASE_PATH . '/vendor/phpunit/phpunit/src/Framework/Assert/Functions.php';
/**
* BasicContext

View File

@ -14,8 +14,7 @@ Behat\Gherkin\Node\TableNode;
use Symfony\Component\DomCrawler\Crawler;
// PHPUnit
require_once 'PHPUnit/Autoload.php';
require_once 'PHPUnit/Framework/Assert/Functions.php';
require_once BASE_PATH . '/vendor/phpunit/phpunit/src/Framework/Assert/Functions.php';
/**
* Context used to define steps related to email sending.

View File

@ -9,8 +9,7 @@ use Behat\Behat\Context\BehatContext,
SilverStripe\Filesystem\Storage\AssetStore;
// PHPUnit
require_once 'PHPUnit/Autoload.php';
require_once 'PHPUnit/Framework/Assert/Functions.php';
require_once BASE_PATH . '/vendor/phpunit/phpunit/src/Framework/Assert/Functions.php';
/**
* Context used to create fixtures in the SilverStripe ORM.

View File

@ -11,8 +11,7 @@ use Behat\Gherkin\Node\PyStringNode,
Behat\Gherkin\Node\TableNode;
// PHPUnit
require_once 'PHPUnit/Autoload.php';
require_once 'PHPUnit/Framework/Assert/Functions.php';
require_once BASE_PATH . '/vendor/phpunit/phpunit/src/Framework/Assert/Functions.php';
/**
* LoginContext

View File

@ -20,6 +20,8 @@ use Symfony\Component\Yaml\Yaml;
// Mink etc.
require_once 'vendor/autoload.php';
require_once BASE_PATH . '/vendor/phpunit/phpunit/src/Framework/Assert/Functions.php';
/**
* SilverStripeContext
*