Skip to content

run tests with PHPUnit 12.1 on PHP >= 8.3 #61333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 5, 2025

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Aug 4, 2025

Q A
Branch? 7.4
Bug fix? no
New feature? no
Deprecations? no
Issues
License MIT

@carsonbot carsonbot added this to the 7.4 milestone Aug 4, 2025
@xabbuh
Copy link
Member Author

xabbuh commented Aug 4, 2025

Status: Needs work

@xabbuh xabbuh changed the title run tests with PHPUnit 12.1 on PHP >= 8.3 [WIP] run tests with PHPUnit 12.1 on PHP >= 8.3 Aug 4, 2025

$this->assertSamePath(\PHP_BINARY, $result);
} finally {
ini_set('open_basedir', $initialOpenBaseDir);
Copy link
Member Author

@xabbuh xabbuh Aug 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This never used to work as expected as you cannot widen the open basedir restrictions after tightening it before. Later on when PHPUnit cleaned up the test environment this led to a PHP warning which in turn lets the test fail:

src/Symfony/Component/Process                                                19s
+ /home/runner/work/symfony/symfony/phpunit --exclude-group tty --exclude-group benchmark --exclude-group intl-data --exclude-group integration --exclude-group transient src/Symfony/Component/Process
PHPUnit 12.1.6 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.3.23
Configuration: /home/runner/work/symfony/symfony/phpunit.xml.dist

........WS.S...................................................  63 / 186 ( 33%)
...................SSS......................................... 126 / 186 ( 67%)
...........................................................S    186 / 186 (100%)

Time: 00:19.259, Memory: 16.00 MB

1 test triggered 1 PHP warning:

1) /home/runner/work/symfony/symfony/.phpunit/phpunit-12.1-0/src/Framework/TestCase.php:1290
ini_set(): open_basedir restriction in effect. File() is not within the allowed path(s): (/usr/bin:/)

Triggered by:

* Symfony\Component\Process\Tests\ExecutableFinderTest::testFindWithOpenBaseDir
  /home/runner/work/symfony/symfony/src/Symfony/Component/Process/Tests/ExecutableFinderTest.php:115

@xabbuh
Copy link
Member Author

xabbuh commented Aug 4, 2025

Status: Needs Review

@xabbuh xabbuh changed the title [WIP] run tests with PHPUnit 12.1 on PHP >= 8.3 run tests with PHPUnit 12.1 on PHP >= 8.3 Aug 4, 2025
@derrabus
Copy link
Member

derrabus commented Aug 5, 2025

Why not 12.3?

@xabbuh
Copy link
Member Author

xabbuh commented Aug 5, 2025

That's the ultimate goal, but we have to fix issues with every minor update we do for PHPUnit. That's why I am doing it step by step.

@nicolas-grekas
Copy link
Member

Thank you @xabbuh.

@nicolas-grekas nicolas-grekas merged commit f49dbb5 into symfony:7.4 Aug 5, 2025
12 checks passed
@xabbuh xabbuh deleted the phpunit12.1 branch August 5, 2025 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy