Make it easy for Drupal to use the PHPUnit bridge
This commit is contained in:
parent
3e3e74c3fa
commit
1de6bf87b9
@ -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);
|
||||
|
@ -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');
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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';
|
||||
|
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user