8000 minor #58680 [PhpUnitBridge] Don't use `die()` in PHPT `--SKIPIF--` (… · symfony/symfony@9b0ca99 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9b0ca99

Browse files
committed
minor #58680 [PhpUnitBridge] Don't use die() in PHPT --SKIPIF-- (staabm)
This PR was merged into the 7.2 branch. Discussion ---------- [PhpUnitBridge] Don't use `die()` in PHPT `--SKIPIF--` | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | -- | License | MIT Unlocks a performance optimization in PHPUnit 11.5.x [PHPUnit 11.5.x will be able to avoid subprocess creation](sebastianbergmann/phpunit#5998), when `--SKIPIF--` code in PHPT tests does not `exit()` or `die()` and the logic is side-effect free (output is allowed). more details in https://staabm.github.io/2024/10/19/phpunit-codesprint-munich.html Commits ------- 83b09ba Don't use `die()` in PHPT `--SKIPIF--`
2 parents 57028ec + 83b09ba commit 9b0ca99

File tree

9 files changed

+11
-11
lines changed

9 files changed

+11
-11
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
Test DeprecationErrorHandler with log file
33
--SKIPIF--
4-
<?php if (!getenv('SYMFONY_PHPUNIT_VERSION') || version_compare(getenv('SYMFONY_PHPUNIT_VERSION'), '10.0', '>=')) die('Skipping on PHPUnit 10+');
4+
<?php if (!getenv('SYMFONY_PHPUNIT_VERSION') || version_compare(getenv('SYMFONY_PHPUNIT_VERSION'), '10.0', '>=')) echo 'Skipping on PHPUnit 10+';
55
--FILE--
66
<?php
77
$filename = tempnam(sys_get_temp_dir(), 'sf-');

src/Symfony/Bridge/PhpUnit/Tests/expectdeprecationfail.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
Test ExpectDeprecationTrait failing tests
33
--SKIPIF--
4-
<?php if (!getenv('SYMFONY_PHPUNIT_VERSION') || version_compare(getenv('SYMFONY_PHPUNIT_VERSION'), '10.0', '>=')) die('Skipping on PHPUnit 10+');
4+
<?php if (!getenv('SYMFONY_PHPUNIT_VERSION') || version_compare(getenv('SYMFONY_PHPUNIT_VERSION'), '10.0', '>=')) echo 'Skipping on PHPUnit 10+';
55
--FILE--
66
<?php
77
$test = realpath(__DIR__.'/FailTests/ExpectDeprecationTraitTestFail.php');

src/Symfony/Bridge/PhpUnit/Tests/expectnotrisky.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Test NoAssertionsTestNotRisky not risky test
33
--SKIPIF--
44
<?php
5-
if ('\\' === DIRECTORY_SEPARATOR && !extension_loaded('mbstring')) die('Skipping on Windows without mbstring');
6-
if (!getenv('SYMFONY_PHPUNIT_VERSION') || version_compare(getenv('SYMFONY_PHPUNIT_VERSION'), '10.0', '>=')) die('Skipping on PHPUnit 10+');
5+
if ('\\' === DIRECTORY_SEPARATOR && !extension_loaded('mbstring')) echo 'Skipping on Windows without mbstring';
6+
if (!getenv('SYMFONY_PHPUNIT_VERSION') || version_compare(getenv('SYMFONY_PHPUNIT_VERSION'), '10.0', '>=')) echo 'Skipping on PHPUnit 10+';
77
--FILE--
88
<?php
99
$test = realpath(__DIR__.'/FailTests/NoAssertionsTestNotRisky.php');

src/Symfony/Bridge/PhpUnit/Tests/expectrisky.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Test NoAssertionsTestRisky risky test
33
--SKIPIF--
44
<?php
5-
if ('\\' === DIRECTORY_SEPARATOR && !extension_loaded('mbstring')) die('Skipping on Windows without mbstring');
6-
if (!getenv('SYMFONY_PHPUNIT_VERSION') || version_compare(getenv('SYMFONY_PHPUNIT_VERSION'), '10.0', '>=')) die('Skipping on PHPUnit 10+');
5+
if ('\\' === DIRECTORY_SEPARATOR && !extension_loaded('mbstring')) echo 'Skipping on Windows without mbstring';
6+
if (!getenv('SYMFONY_PHPUNIT_VERSION') || version_compare(getenv('SYMFONY_PHPUNIT_VERSION'), '10.0', '>=')) echo 'Skipping on PHPUnit 10+';
77
--FILE--
88
<?php
99
$test = realpath(__DIR__.'/FailTests/NoAssertionsTestRisky.php');

src/Symfony/Bridge/PhpUnit/Tests/symfonyextension.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
--SKIPIF--
33
<?php
4-
if (!getenv('SYMFONY_PHPUNIT_VERSION') || version_compare(getenv('SYMFONY_PHPUNIT_VERSION'), '10', '<')) die('Skipping on PHPUnit < 10');
4+
if (!getenv('SYMFONY_PHPUNIT_VERSION') || version_compare(getenv('SYMFONY_PHPUNIT_VERSION'), '10', '<')) echo 'Skipping on PHPUnit < 10';
55
--FILE--
66
<?php
77
passthru(\sprintf('NO_COLOR=1 php %s/simple-phpunit.php -c %s/Fixtures/symfonyextension/phpunit-with-extension.xml.dist %s/SymfonyExtension.php', getenv('SYMFONY_SIMPLE_PHPUNIT_BIN_DIR'), __DIR__, __DIR__));

src/Symfony/Bridge/PhpUnit/Tests/symfonyextensionnotregistered.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
--SKIPIF--
33
<?php
4-
if (!getenv('SYMFONY_PHPUNIT_VERSION') || version_compare(getenv('SYMFONY_PHPUNIT_VERSION'), '10', '<')) die('Skipping on PHPUnit < 10');
4+
if (!getenv('SYMFONY_PHPUNIT_VERSION') || version_compare(getenv('SYMFONY_PHPUNIT_VERSION'), '10', '<')) echo 'Skipping on PHPUnit < 10';
55
--FILE--
66
<?php
77
passthru(\sprintf('NO_COLOR=1 php %s/simple-phpunit.php -c %s/Fixtures/symfonyextension/phpunit-without-extension.xml.dist %s/SymfonyExtension.php', getenv('SYMFONY_SIMPLE_PHPUNIT_BIN_DIR'), __DIR__, __DIR__));

src/Symfony/Component/Console/Tests/phpt/alarm/command_exit.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
Test command that exits
33
--SKIPIF--
4-
<?php if (!extension_loaded("pcntl")) die("Skipped: pcntl extension required."); ?>
4+
<?php if (!extension_loaded("pcntl")) echo "Skipped: pcntl extension required."; ?>
55
--FILE--
66
<?php
77

src/Symfony/Component/Console/Tests/phpt/signal/command_exit.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
Test command that exits
33
--SKIPIF--
4-
<?php if (!extension_loaded("pcntl")) die("Skipped: pcntl extension required."); ?>
4+
<?php if (!extension_loaded("pcntl")) echo "Skipped: pcntl extension required."; ?>
55
--FILE--
66
<?php
77

src/Symfony/Component/Runtime/Tests/phpt/dotenv_overload.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
Test Dotenv overload
33
--SKIPIF--
4-
<?php require dirname(__DIR__, 6).'/vendor/autoload.php'; if (4 > (new \ReflectionMethod(\Symfony\Component\Dotenv\Dotenv::class, 'bootEnv'))->getNumberOfParameters()) die('Skip because Dotenv version is too low');
4+
<?php require dirname(__DIR__, 6).'/vendor/autoload.php'; if (4 > (new \ReflectionMethod(\Symfony\Component\Dotenv\Dotenv::class, 'bootEnv'))->getNumberOfParameters()) echo 'Skip because Dotenv version is too low';
55
--INI--
66
display_errors=1
77
--FILE--

0 commit comments

Comments
 (0)
0