Skip to content

Suppress warning when file's not readable #247

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 2 commits into from
May 28, 2025
Merged

Conversation

mbeccati
Copy link
Contributor

1 test triggered 1 PHP warning:

1) /home/matteo/OSS/pie/src/Installing/Ini/AddExtensionToTheIniFile.php:45
file_get_contents(/tmp/PIE_unreadable_ini_fileCIbpMY): Failed to open stream: Permission denied

Triggered by:

* Php\PieUnitTest\Installing\Ini\AddExtensionToTheIniFileTest::testReturnsFalseWhenExistingIniCouldNotBeRead
  /home/matteo/OSS/pie/test/unit/Installing/Ini/AddExtensionToTheIniFileTest.php:115

on my CI, now also running pie tests with the latest nightly PHP versions (except master, currently):

https://github.com/mbeccati/php-latest-builds/actions/runs/15116912401/job/42489797649

@asgrim asgrim self-assigned this May 19, 2025
@asgrim asgrim added the enhancement New feature or request label May 19, 2025
Copy link
Collaborator

@asgrim asgrim left a comment

Choose a reason for hiding this comment

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

Thanks @mbeccati !

@asgrim asgrim added this to the 0.13.0 milestone May 28, 2025
@asgrim asgrim merged commit c25ff87 into php:main May 28, 2025
19 checks passed
@mbeccati
Copy link
Contributor Author

Thanks @asgrim

With the fix I'm now getting:

There was 1 failure:

1) Php\PieUnitTest\Installing\Ini\AddExtensionToTheIniFileTest::testReturnsFalseWhenExistingIniCouldNotBeRead
Failed asserting that 'Could not read /tmp/PIE_unreadable_ini_filepllqk743e0pedMcTtME to make a backup of it, aborting enablement of extension\n
' [ASCII](length: 120) contains "Tried making a backup of /tmp/PIE_unreadable_ini_filepllqk743e0pedMcTtME but could not read it, aborting enablement of extension" [ASCII](length: 128).

/home/runner/work/php-latest-builds/php-latest-builds/test/unit/Installing/Ini/AddExtensionToTheIniFileTest.php:141

@mbeccati mbeccati deleted the fix-warning branch May 29, 2025 11:45
mbeccati added a commit to mbeccati/pie that referenced this pull request May 29, 2025
asgrim added a commit that referenced this pull request May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants