Make it easy for Drupal to use the PHPUnit bridge

This commit is contained in:
Alex Pott 2017-10-24 20:45:13 +01:00 committed by Nicolas Grekas
parent 3e3e74c3fa
commit 1de6bf87b9
7 changed files with 37 additions and 13 deletions

View File

@ -12,8 +12,12 @@ $vendor = __DIR__;
while (!file_exists($vendor.'/vendor')) {
$vendor = dirname($vendor);
}
define('PHPUNIT_COMPOSER_INSTALL', $vendor.'/vendor/autoload.php');
require PHPUNIT_COMPOSER_INSTALL;
// Fake class to ensure bootstrap.php calls DeprecationErrorHandler::register().
class PHPUnit_TextUI_Command
{
}
require $vendor.'/vendor/autoload.php';
require_once __DIR__.'/../../bootstrap.php';
@trigger_error('root deprecation', E_USER_DEPRECATED);

View File

@ -12,8 +12,12 @@ $vendor = __DIR__;
while (!file_exists($vendor.'/vendor')) {
$vendor = dirname($vendor);
}
define('PHPUNIT_COMPOSER_INSTALL', $vendor.'/vendor/autoload.php');
require PHPUNIT_COMPOSER_INSTALL;
// Fake class to ensure bootstrap.php calls DeprecationErrorHandler::register().
class PHPUnit_TextUI_Command
{
}
require $vendor.'/vendor/autoload.php';
require_once __DIR__.'/../../bootstrap.php';
echo (int) set_error_handler('var_dump');

View File

@ -12,8 +12,12 @@ $vendor = __DIR__;
while (!file_exists($vendor.'/vendor')) {
$vendor = dirname($vendor);
}
define('PHPUNIT_COMPOSER_INSTALL', $vendor.'/vendor/autoload.php');
require PHPUNIT_COMPOSER_INSTALL;
// Fake class to ensure bootstrap.php calls DeprecationErrorHandler::register().
class PHPUnit_TextUI_Command
{
}
require $vendor.'/vendor/autoload.php';
require_once __DIR__.'/../../bootstrap.php';
@trigger_error('root deprecation', E_USER_DEPRECATED);

View File

@ -12,8 +12,12 @@ $vendor = __DIR__;
while (!file_exists($vendor.'/vendor')) {
$vendor = dirname($vendor);
}
define('PHPUNIT_COMPOSER_INSTALL', $vendor.'/vendor/autoload.php');
require PHPUNIT_COMPOSER_INSTALL;
// Fake class to ensure bootstrap.php calls DeprecationErrorHandler::register().
class PHPUnit_TextUI_Command
{
}
require $vendor.'/vendor/autoload.php';
require_once __DIR__.'/../../bootstrap.php';
@trigger_error('root deprecation', E_USER_DEPRECATED);

View File

@ -12,8 +12,12 @@ $vendor = __DIR__;
while (!file_exists($vendor.'/vendor')) {
$vendor = dirname($vendor);
}
define('PHPUNIT_COMPOSER_INSTALL', $vendor.'/vendor/autoload.php');
require PHPUNIT_COMPOSER_INSTALL;
// Fake class to ensure bootstrap.php calls DeprecationErrorHandler::register().
class PHPUnit_TextUI_Command
{
}
require $vendor.'/vendor/autoload.php';
require_once __DIR__.'/../../bootstrap.php';
@trigger_error('root deprecation', E_USER_DEPRECATED);

View File

@ -12,8 +12,12 @@ $vendor = __DIR__;
while (!file_exists($vendor.'/vendor')) {
$vendor = dirname($vendor);
}
define('PHPUNIT_COMPOSER_INSTALL', $vendor.'/vendor/autoload.php');
require PHPUNIT_COMPOSER_INSTALL;
// Fake class to ensure bootstrap.php calls DeprecationErrorHandler::register().
class PHPUnit_TextUI_Command
{
}
require $vendor.'/vendor/autoload.php';
require_once __DIR__.'/../../bootstrap.php';
require __DIR__.'/fake_vendor/autoload.php';
require __DIR__.'/fake_vendor/acme/lib/deprecation_riddled.php';

View File

@ -13,7 +13,7 @@ use Doctrine\Common\Annotations\AnnotationRegistry;
use Symfony\Bridge\PhpUnit\DeprecationErrorHandler;
// Detect if we're loaded by an actual run of phpunit
if (!defined('PHPUNIT_COMPOSER_INSTALL') && !class_exists('PHPUnit_TextUI_Command', false) && !class_exists('PHPUnit\TextUI\Command', false)) {
if (!class_exists('PHPUnit_TextUI_Command', false) && !class_exists('PHPUnit\TextUI\Command', false)) {
if ($ser = getenv('SYMFONY_DEPRECATIONS_SERIALIZE')) {
DeprecationErrorHandler::collectDeprecations($ser);
}