mirror of
https://github.com/silverstripe/silverstripe-behat-extension
synced 2024-10-22 17:05:32 +02:00
MNT Add support for sminnee/phpunit fork
This commit is contained in:
parent
8dc02fd0db
commit
892aee9592
@ -15,13 +15,15 @@ matrix:
|
||||
env: PHPUNIT_TEST=1
|
||||
- php: 7.3
|
||||
env: PHPUNIT_TEST=1 PHPCS_TEST=1
|
||||
- php: 7.4
|
||||
env: PHPUNIT_TEST=1
|
||||
|
||||
|
||||
|
||||
before_script:
|
||||
- export PATH=~/.composer/vendor/bin:$PATH
|
||||
- composer validate
|
||||
- composer install --dev --prefer-dist
|
||||
- composer install --prefer-dist
|
||||
- composer require --prefer-dist --no-update silverstripe/recipe-core:^4
|
||||
- composer update
|
||||
- if [[ $PHPCS_TEST ]]; then composer global require squizlabs/php_codesniffer:^3 --prefer-dist --no-interaction --no-progress --no-suggest -o; fi
|
||||
|
@ -22,7 +22,7 @@
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.6",
|
||||
"phpunit/phpunit": "^5.7",
|
||||
"sminnee/phpunit": "^5.7",
|
||||
"behat/behat": "^3.2",
|
||||
"behat/mink": "^1.7",
|
||||
"behat/mink-extension": "^2.1",
|
||||
|
@ -15,6 +15,7 @@ use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
use Behat\Testwork\ServiceContainer\ExtensionManager;
|
||||
use Behat\Testwork\ServiceContainer\Extension as ExtensionInterface;
|
||||
use RuntimeException;
|
||||
use Symfony\Component\DependencyInjection\Definition;
|
||||
use Symfony\Component\DependencyInjection\Reference;
|
||||
|
||||
@ -52,8 +53,26 @@ class Extension implements ExtensionInterface
|
||||
|
||||
public function initialize(ExtensionManager $extensionManager)
|
||||
{
|
||||
// PHPUnit
|
||||
require_once BASE_PATH . '/vendor/phpunit/phpunit/src/Framework/Assert/Functions.php';
|
||||
// Find PHPUnit assertion implementations
|
||||
|
||||
$found = false;
|
||||
|
||||
$options = [
|
||||
BASE_PATH . '/vendor/sminnee/phpunit/src/Framework/Assert/Functions.php',
|
||||
BASE_PATH . '/vendor/phpunit/phpunit/src/Framework/Assert/Functions.php'
|
||||
];
|
||||
|
||||
foreach ($options as $file) {
|
||||
if (file_exists($file)) {
|
||||
require_once $file;
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$found) {
|
||||
throw new RuntimeException('Could not find PHPUnit installation');
|
||||
}
|
||||
}
|
||||
|
||||
public function load(ContainerBuilder $container, array $config)
|
||||
|
Loading…
Reference in New Issue
Block a user