Skip to content

Commit 8203281

Browse files
Merge branch '3.3' into 3.4
* 3.3: Make it easy for Drupal to use the PHPUnit bridge
2 parents ed8c731 + 41509a2 commit 8203281

File tree

7 files changed

+37
-13
lines changed

7 files changed

+37
-13
lines changed

src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/default.phpt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ $vendor = __DIR__;
1212
while (!file_exists($vendor.'/vendor')) {
1313
$vendor = dirname($vendor);
1414
}
15-
define('PHPUNIT_COMPOSER_INSTALL', $vendor.'/vendor/autoload.php');
16-
require PHPUNIT_COMPOSER_INSTALL;
15+
// Fake class to ensure bootstrap.php calls DeprecationErrorHandler::register().
16+
class PHPUnit_TextUI_Command
17+
{
18+
19+
}
20+
require $vendor.'/vendor/autoload.php';
1721
require_once __DIR__.'/../../bootstrap.php';
1822

1923
@trigger_error('root deprecation', E_USER_DEPRECATED);

src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/disabled.phpt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ $vendor = __DIR__;
1212
while (!file_exists($vendor.'/vendor')) {
1313
$vendor = dirname($vendor);
1414
}
15-
define('PHPUNIT_COMPOSER_INSTALL', $vendor.'/vendor/autoload.php');
16-
require PHPUNIT_COMPOSER_INSTALL;
15+
// Fake class to ensure bootstrap.php calls DeprecationErrorHandler::register().
16+
class PHPUnit_TextUI_Command
17+
{
18+
19+
}
20+
require $vendor.'/vendor/autoload.php';
1721
require_once __DIR__.'/../../bootstrap.php';
1822

1923
echo (int) set_error_handler('var_dump');

src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/regexp.phpt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ $vendor = __DIR__;
1212
while (!file_exists($vendor.'/vendor')) {
1313
$vendor = dirname($vendor);
1414
}
15-
define('PHPUNIT_COMPOSER_INSTALL', $vendor.'/vendor/autoload.php');
16-
require PHPUNIT_COMPOSER_INSTALL;
15+
// Fake class to ensure bootstrap.php calls DeprecationErrorHandler::register().
16+
class PHPUnit_TextUI_Command
17+
{
18+
19+
}
20+
require $vendor.'/vendor/autoload.php';
1721
require_once __DIR__.'/../../bootstrap.php';
1822

1923
@trigger_error('root deprecation', E_USER_DEPRECATED);

src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak.phpt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ $vendor = __DIR__;
1212
while (!file_exists($vendor.'/vendor')) {
1313
$vendor = dirname($vendor);
1414
}
15-
define('PHPUNIT_COMPOSER_INSTALL', $vendor.'/vendor/autoload.php');
16-
require PHPUNIT_COMPOSER_INSTALL;
15+
// Fake class to ensure bootstrap.php calls DeprecationErrorHandler::register().
16+
class PHPUnit_TextUI_Command
17+
{
18+
19+
}
20+
require $vendor.'/vendor/autoload.php';
1721
require_once __DIR__.'/../../bootstrap.php';
1822

1923
@trigger_error('root deprecation', E_USER_DEPRECATED);

src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak_vendors_on_non_vendor.phpt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ $vendor = __DIR__;
1212
while (!file_exists($vendor.'/vendor')) {
1313
$vendor = dirname($vendor);
1414
}
15-
define('PHPUNIT_COMPOSER_INSTALL', $vendor.'/vendor/autoload.php');
16-
require PHPUNIT_COMPOSER_INSTALL;
15+
// Fake class to ensure bootstrap.php calls DeprecationErrorHandler::register().
16+
class PHPUnit_TextUI_Command
17+
{
18+
19+
}
20+
require $vendor.'/vendor/autoload.php';
1721
require_once __DIR__.'/../../bootstrap.php';
1822

1923
@trigger_error('root deprecation', E_USER_DEPRECATED);

src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak_vendors_on_vendor.phpt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ $vendor = __DIR__;
1212
while (!file_exists($vendor.'/vendor')) {
1313
$vendor = dirname($vendor);
1414
}
15-
define('PHPUNIT_COMPOSER_INSTALL', $vendor.'/vendor/autoload.php');
16-
require PHPUNIT_COMPOSER_INSTALL;
15+
// Fake class to ensure bootstrap.php calls DeprecationErrorHandler::register().
16+
class PHPUnit_TextUI_Command
17+
{
18+
19+
}
20+
require $vendor.'/vendor/autoload.php';
1721
require_once __DIR__.'/../../bootstrap.php';
1822
require __DIR__.'/fake_vendor/autoload.php';
1923
require __DIR__.'/fake_vendor/acme/lib/deprecation_riddled.php';

src/Symfony/Bridge/PhpUnit/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use Symfony\Bridge\PhpUnit\DeprecationErrorHandler;
1414

1515
// Detect if we're loaded by an actual run of phpunit
16-
if (!defined('PHPUNIT_COMPOSER_INSTALL') && !class_exists('PHPUnit_TextUI_Command', false) && !class_exists('PHPUnit\TextUI\Command', false)) {
16+
if (!class_exists('PHPUnit_TextUI_Command', false) && !class_exists('PHPUnit\TextUI\Command', false)) {
1717
if ($ser = getenv('SYMFONY_DEPRECATIONS_SERIALIZE')) {
1818
DeprecationErrorHandler::collectDeprecations($ser);
1919
}

0 commit comments

Comments
 (0)