Skip to content

Commit

Permalink
Don't use die() in PHPT --SKIPIF--
Browse files Browse the repository at this point in the history
Unlocks a performance optimization in PHPUnit 11.x

see https://staabm.github.io/2024/10/19/phpunit-codesprint-munich.html
  • Loading branch information
staabm committed Oct 27, 2024
1 parent 078398e commit 0228dd1
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Tests/DeprecationErrorHandler/log_file.phpt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--TEST--
Test DeprecationErrorHandler with log file
--SKIPIF--
<?php if (!getenv('SYMFONY_PHPUNIT_VERSION') || version_compare(getenv('SYMFONY_PHPUNIT_VERSION'), '10.0', '>=')) die('Skipping on PHPUnit 10+');
<?php if (!getenv('SYMFONY_PHPUNIT_VERSION') || version_compare(getenv('SYMFONY_PHPUNIT_VERSION'), '10.0', '>=')) echo 'Skipping on PHPUnit 10+';
--FILE--
<?php
$filename = tempnam(sys_get_temp_dir(), 'sf-');
Expand Down
2 changes: 1 addition & 1 deletion Tests/expectdeprecationfail.phpt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--TEST--
Test ExpectDeprecationTrait failing tests
--SKIPIF--
<?php if (!getenv('SYMFONY_PHPUNIT_VERSION') || version_compare(getenv('SYMFONY_PHPUNIT_VERSION'), '10.0', '>=')) die('Skipping on PHPUnit 10+');
<?php if (!getenv('SYMFONY_PHPUNIT_VERSION') || version_compare(getenv('SYMFONY_PHPUNIT_VERSION'), '10.0', '>=')) echo 'Skipping on PHPUnit 10+';
--FILE--
<?php
$test = realpath(__DIR__.'/FailTests/ExpectDeprecationTraitTestFail.php');
Expand Down
4 changes: 2 additions & 2 deletions Tests/expectnotrisky.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Test NoAssertionsTestNotRisky not risky test
--SKIPIF--
<?php
if ('\\' === DIRECTORY_SEPARATOR && !extension_loaded('mbstring')) die('Skipping on Windows without mbstring');
if (!getenv('SYMFONY_PHPUNIT_VERSION') || version_compare(getenv('SYMFONY_PHPUNIT_VERSION'), '10.0', '>=')) die('Skipping on PHPUnit 10+');
if ('\\' === DIRECTORY_SEPARATOR && !extension_loaded('mbstring')) echo 'Skipping on Windows without mbstring';
if (!getenv('SYMFONY_PHPUNIT_VERSION') || version_compare(getenv('SYMFONY_PHPUNIT_VERSION'), '10.0', '>=')) echo 'Skipping on PHPUnit 10+';
--FILE--
<?php
$test = realpath(__DIR__.'/FailTests/NoAssertionsTestNotRisky.php');
Expand Down
4 changes: 2 additions & 2 deletions Tests/expectrisky.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Test NoAssertionsTestRisky risky test
--SKIPIF--
<?php
if ('\\' === DIRECTORY_SEPARATOR && !extension_loaded('mbstring')) die('Skipping on Windows without mbstring');
if (!getenv('SYMFONY_PHPUNIT_VERSION') || version_compare(getenv('SYMFONY_PHPUNIT_VERSION'), '10.0', '>=')) die('Skipping on PHPUnit 10+');
if ('\\' === DIRECTORY_SEPARATOR && !extension_loaded('mbstring')) echo 'Skipping on Windows without mbstring';
if (!getenv('SYMFONY_PHPUNIT_VERSION') || version_compare(getenv('SYMFONY_PHPUNIT_VERSION'), '10.0', '>=')) echo 'Skipping on PHPUnit 10+';
--FILE--
<?php
$test = realpath(__DIR__.'/FailTests/NoAssertionsTestRisky.php');
Expand Down
2 changes: 1 addition & 1 deletion Tests/symfonyextension.phpt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--TEST--
--SKIPIF--
<?php
if (!getenv('SYMFONY_PHPUNIT_VERSION') || version_compare(getenv('SYMFONY_PHPUNIT_VERSION'), '10', '<')) die('Skipping on PHPUnit < 10');
if (!getenv('SYMFONY_PHPUNIT_VERSION') || version_compare(getenv('SYMFONY_PHPUNIT_VERSION'), '10', '<')) echo 'Skipping on PHPUnit < 10';
--FILE--
<?php
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__));
Expand Down
2 changes: 1 addition & 1 deletion Tests/symfonyextensionnotregistered.phpt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--TEST--
--SKIPIF--
<?php
if (!getenv('SYMFONY_PHPUNIT_VERSION') || version_compare(getenv('SYMFONY_PHPUNIT_VERSION'), '10', '<')) die('Skipping on PHPUnit < 10');
if (!getenv('SYMFONY_PHPUNIT_VERSION') || version_compare(getenv('SYMFONY_PHPUNIT_VERSION'), '10', '<')) echo 'Skipping on PHPUnit < 10';
--FILE--
<?php
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__));
Expand Down

0 comments on commit 0228dd1

Please sign in to comment.