Skip to content

Conversation

mvorisek
Copy link
Contributor

@mvorisek mvorisek commented Jun 6, 2025

fix #6197

rebased version of #6208 (because of #6208 (comment))

}
} elseif ($this->expectErrorLog) {
$this->markTestIncomplete('Could not create writable error_log file.');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unresolved feedback from the original PR - #6208 (comment)

The question is what to throw here, incomplete, risky, ...?

Copy link
Contributor Author

@mvorisek mvorisek Jul 20, 2025

Choose a reason for hiding this comment

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

@sebastianbergmann kindly ping as discussed in the previous PR.

Choose a reason for hiding this comment

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

Treating the test as incomplete (or risky) is too weak, IMO. This should be an error.

@sebastianbergmann sebastianbergmann deleted the branch sebastianbergmann:12.3 July 31, 2025 12:00
@sebastianbergmann
Copy link
Owner

sebastianbergmann commented Jul 31, 2025

I forgot about branch retargeting (again). However, I was able to regarget this pull request to 12.3. Sorry for the noise.

@sebastianbergmann sebastianbergmann changed the base branch from 12.2 to 12.3 July 31, 2025 12:50
@sebastianbergmann
Copy link
Owner

The more I think about #6197 and the changes proposed here to address it, the more I seem to lean towards "won't fix".

PHPUnit is a development tool that should only be used in a development environment. I cannot think of a situation where it makes sense to configure open_basedir in a development environment so that error_log() does not work. But maybe I am missing something?

As it stands, I am not convinced that the added complexity of providing a more specific error message for this edge case is worthwhile.

@mvorisek
Copy link
Contributor Author

We run our whole development (and production) suite with open_basedir configured.

The reason is we can protect our enviroment (project's unrelated files) better. This way we also assert no code accesses locations outside the projects.

This single issue prevents us to upgrade to PHPUnit 12.

I hope this can be fixed. I hope this PR is more like a bugfix, the tmp location can be readonly, not accessible at all, etc., so the file creation should be handled in any case.

To finish this PR, I have reopened #6227 (comment) discussion. Please guide me how to emit an error you want or feel free to commit into this PR directly.

@sebastianbergmann
Copy link
Owner

This pull request has conflicts that must be resolved.

@mvorisek
Copy link
Contributor Author

PR rebased

@sebastianbergmann
Copy link
Owner

Thank you for your patience.

I have cherry-picked your changes to 12.3, refactored the code, and changed it to treat the situation where a file for error_log() capturing cannot be created as an error.

@mvorisek
Copy link
Contributor Author

Thank you!

For documentation purposes, the change is in cc6414a.

@mvorisek mvorisek deleted the fix_6197 branch August 12, 2025 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants