phpunit icon indicating copy to clipboard operation
phpunit copied to clipboard

`ini_set('error_log'` sets filepath outside `open_basedir`

Open mvorisek opened this issue 7 months ago • 2 comments

Q A
PHPUnit version 12.1.0-now
PHP version unrelated
Installation Method Composer

Summary

introduced in https://github.com/sebastianbergmann/phpunit/pull/6127 & #6118

merged as https://github.com/sebastianbergmann/phpunit/commit/3f275eb84301b290d2bdca4b6891b07487c9860d

/cc @staabm

Current behavior

Time: 00:00.573, Memory: 8.00 MB
1 test triggered 1 PHP warning:
1) /builds/mvorisek/atk4-hintable/vendor/phpunit/phpunit/src/Framework/TestCase.php:1290
ini_set(): open_basedir restriction in effect. File() is not within the allowed path(s):
    (/builds/mvorisek/atk4-hintable:/tmp)
Triggered by:
* Mvorisek\Atk4\Hintable\Tests\Core\MethodTest::testMethodName
  /builds/mvorisek/atk4-hintable/tests/Core/MethodTest.php:13
OK, but there were issues!
Tests: 151, Assertions: 463, Warnings: 1.

How to reproduce

Run phpunit with open_basedir configured.

repro code: https://github.com/mvorisek/atk4-hintable-mirror/tree/dde63a7362f2aacacf1e91b8fda2ea6adcb0bcc9

(but it seems it is not related with https://github.com/mvorisek/atk4-hintable-mirror/blob/dde63a7362f2aacacf1e91b8fda2ea6adcb0bcc9/tests/Core/MethodTest.php#L13 specific test, the test name in the report is there as it is the 1st one executed)

Expected behavior

no error

mvorisek avatar May 01 '25 12:05 mvorisek

Could you PR a small reproducer of the problem as PHPT test?

staabm avatar May 10 '25 05:05 staabm

@staabm can I have your review on #6208?

mvorisek avatar May 11 '25 10:05 mvorisek