Merge branch '3.3' into 3.4
* 3.3: [Bridge/PhpUnit] Fix compat with phpunit 4.8 & bridge <=3.3.13 Remove function_exists(__phpunit_run_isolated_test) checks
This commit is contained in:
commit
4baf9688a9
|
@ -98,7 +98,7 @@
|
||||||
"ocramius/proxy-manager": "~0.4|~1.0|~2.0",
|
"ocramius/proxy-manager": "~0.4|~1.0|~2.0",
|
||||||
"predis/predis": "~1.0",
|
"predis/predis": "~1.0",
|
||||||
"egulias/email-validator": "~1.2,>=1.2.8|~2.0",
|
"egulias/email-validator": "~1.2,>=1.2.8|~2.0",
|
||||||
"symfony/phpunit-bridge": "~3.2",
|
"symfony/phpunit-bridge": "~3.4|~4.0",
|
||||||
"symfony/security-acl": "~2.8|~3.0",
|
"symfony/security-acl": "~2.8|~3.0",
|
||||||
"phpdocumentor/reflection-docblock": "^3.0|^4.0"
|
"phpdocumentor/reflection-docblock": "^3.0|^4.0"
|
||||||
},
|
},
|
||||||
|
|
|
@ -23,12 +23,19 @@ class Blacklist
|
||||||
|
|
||||||
public function getBlacklistedDirectories()
|
public function getBlacklistedDirectories()
|
||||||
{
|
{
|
||||||
$root = dirname(__DIR__);
|
$blacklist = array();
|
||||||
while ($root !== $parent = dirname($root)) {
|
|
||||||
$root = $parent;
|
foreach (get_declared_classes() as $class) {
|
||||||
|
if ('C' === $class[0] && 0 === strpos($class, 'ComposerAutoloaderInit')) {
|
||||||
|
$r = new \ReflectionClass($class);
|
||||||
|
$v = dirname(dirname($r->getFileName()));
|
||||||
|
if (file_exists($v.'/composer/installed.json')) {
|
||||||
|
$blacklist[] = $v;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return array($root);
|
return $blacklist;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isBlacklisted($file)
|
public function isBlacklisted($file)
|
||||||
|
@ -37,5 +44,9 @@ class Blacklist
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (class_exists('PHPUnit\Util\Test')) {
|
||||||
class_alias('Symfony\Bridge\PhpUnit\Blacklist', 'PHPUnit\Util\Blacklist');
|
class_alias('Symfony\Bridge\PhpUnit\Blacklist', 'PHPUnit\Util\Blacklist');
|
||||||
|
}
|
||||||
|
if (class_exists('PHPUnit_Util_Test')) {
|
||||||
class_alias('Symfony\Bridge\PhpUnit\Blacklist', 'PHPUnit_Util_Blacklist');
|
class_alias('Symfony\Bridge\PhpUnit\Blacklist', 'PHPUnit_Util_Blacklist');
|
||||||
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
|
||||||
if (5.1 <= $PHPUNIT_VERSION && $PHPUNIT_VERSION < 5.4) {
|
if (5.1 <= $PHPUNIT_VERSION && $PHPUNIT_VERSION < 5.4) {
|
||||||
passthru("$COMPOSER require --no-update phpunit/phpunit-mock-objects \"~3.1.0\"");
|
passthru("$COMPOSER require --no-update phpunit/phpunit-mock-objects \"~3.1.0\"");
|
||||||
}
|
}
|
||||||
passthru("$COMPOSER require --no-update symfony/phpunit-bridge \"~3.3.11@dev|~3.4.0-beta2@dev|^4.0.0-beta2@dev\"");
|
passthru("$COMPOSER require --no-update symfony/phpunit-bridge \"~3.4-beta5@dev|^4.0-beta5@dev\"");
|
||||||
$prevRoot = getenv('COMPOSER_ROOT_VERSION');
|
$prevRoot = getenv('COMPOSER_ROOT_VERSION');
|
||||||
putenv("COMPOSER_ROOT_VERSION=$PHPUNIT_VERSION.99");
|
putenv("COMPOSER_ROOT_VERSION=$PHPUNIT_VERSION.99");
|
||||||
$exit = proc_close(proc_open("$COMPOSER install --no-dev --prefer-dist --no-progress --ansi", array(), $p, getcwd(), null, array('bypass_shell' => true)));
|
$exit = proc_close(proc_open("$COMPOSER install --no-dev --prefer-dist --no-progress --ansi", array(), $p, getcwd(), null, array('bypass_shell' => true)));
|
||||||
|
|
|
@ -13,7 +13,9 @@ use Doctrine\Common\Annotations\AnnotationRegistry;
|
||||||
use Symfony\Bridge\PhpUnit\DeprecationErrorHandler;
|
use Symfony\Bridge\PhpUnit\DeprecationErrorHandler;
|
||||||
|
|
||||||
// Replace the native phpunit Blacklist, it's a broken artifact from the past
|
// Replace the native phpunit Blacklist, it's a broken artifact from the past
|
||||||
|
if (!class_exists('Symfony\Bridge\PhpUnit\Blacklist', false)) {
|
||||||
require_once __DIR__.'/Blacklist.php';
|
require_once __DIR__.'/Blacklist.php';
|
||||||
|
}
|
||||||
|
|
||||||
// Detect if we need to serialize deprecations to a file.
|
// Detect if we need to serialize deprecations to a file.
|
||||||
if ($file = getenv('SYMFONY_DEPRECATIONS_SERIALIZE')) {
|
if ($file = getenv('SYMFONY_DEPRECATIONS_SERIALIZE')) {
|
||||||
|
|
|
@ -2,9 +2,7 @@
|
||||||
|
|
||||||
namespace Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Validation;
|
namespace Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Validation;
|
||||||
|
|
||||||
if (!function_exists('__phpunit_run_isolated_test')) {
|
|
||||||
class Article implements NotExistingInterface
|
class Article implements NotExistingInterface
|
||||||
{
|
{
|
||||||
public $category;
|
public $category;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
namespace Symfony\Component\Config\Tests\Fixtures;
|
namespace Symfony\Component\Config\Tests\Fixtures;
|
||||||
|
|
||||||
if (!function_exists('__phpunit_run_isolated_test')) {
|
|
||||||
class BadParent extends MissingParent
|
class BadParent extends MissingParent
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if (!function_exists('__phpunit_run_isolated_test')) {
|
|
||||||
throw new \Exception('boo');
|
throw new \Exception('boo');
|
||||||
}
|
|
||||||
|
|
|
@ -13,8 +13,6 @@ namespace Symfony\Component\DependencyInjection\Tests\Compiler;
|
||||||
|
|
||||||
use Symfony\Bug\NotExistClass;
|
use Symfony\Bug\NotExistClass;
|
||||||
|
|
||||||
if (!function_exists('__phpunit_run_isolated_test')) {
|
|
||||||
class OptionalServiceClass extends NotExistClass
|
class OptionalServiceClass extends NotExistClass
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if (function_exists('__phpunit_run_isolated_test')) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
/** @var $loader \Symfony\Component\Routing\Loader\PhpFileLoader */
|
/** @var $loader \Symfony\Component\Routing\Loader\PhpFileLoader */
|
||||||
/** @var \Symfony\Component\Routing\RouteCollection $collection */
|
/** @var \Symfony\Component\Routing\RouteCollection $collection */
|
||||||
$collection = $loader->import('validpattern.php');
|
$collection = $loader->import('validpattern.php');
|
||||||
|
|
Reference in New Issue