diff --git a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/default.phpt b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/default.phpt index cd733724870cd..db60e3d25076e 100644 --- a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/default.phpt +++ b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/default.phpt @@ -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); diff --git a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/disabled.phpt b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/disabled.phpt index 0115bbd24259a..b2aa84f3b84d7 100644 --- a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/disabled.phpt +++ b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/disabled.phpt @@ -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'); diff --git a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/regexp.phpt b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/regexp.phpt index 3b7207b85f8ee..2bea6d3bb5fcb 100644 --- a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/regexp.phpt +++ b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/regexp.phpt @@ -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); diff --git a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak.phpt b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak.phpt index 9e78d96e70efb..e65cd8648dfc0 100644 --- a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak.phpt +++ b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak.phpt @@ -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); diff --git a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak_vendors_on_non_vendor.phpt b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak_vendors_on_non_vendor.phpt index 7568d54a9ce91..a56db364171b2 100644 --- a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak_vendors_on_non_vendor.phpt +++ b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak_vendors_on_non_vendor.phpt @@ -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); diff --git a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak_vendors_on_vendor.phpt b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak_vendors_on_vendor.phpt index 7e9c6f8ed7682..f43ebde4929b7 100644 --- a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak_vendors_on_vendor.phpt +++ b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak_vendors_on_vendor.phpt @@ -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'; diff --git a/src/Symfony/Bridge/PhpUnit/bootstrap.php b/src/Symfony/Bridge/PhpUnit/bootstrap.php index 2803caf02bcae..570eb97389a9e 100644 --- a/src/Symfony/Bridge/PhpUnit/bootstrap.php +++ b/src/Symfony/Bridge/PhpUnit/bootstrap.php @@ -13,7 +13,7 @@ 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); }