Add quoting and escaping, fix off settings skipped, fix completely wrong diff if multiple .ini loaded#76
Add quoting and escaping, fix off settings skipped, fix completely wrong diff if multiple .ini loaded#76kkmuffme wants to merge 3 commits into
Conversation
kkmuffme
commented
Jan 9, 2026
- Fix Ini setting with special chars breaks parsing #64 by adding appropriate quoting and escaping
- "off" values are simply ignored too for whatever reason...
- it's wrong if no ini loaded at all
- it unnecessarily sets values if they are not set in all ini files, but instead it should check if it's set in any ini file. This currently leads to the returned current settings array being about n*m (number of options * number of ini files loaded) times larger than necessary
- the existing tests are lacking, and they continue to do so (since there's no way to create an ini and load it in the test to test for the "=" values and/or no ini and/or value only set in some ini files)
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 8.0 #76 +/- ##
============================================
+ Coverage 48.46% 48.90% +0.44%
- Complexity 73 74 +1
============================================
Files 2 2
Lines 130 137 +7
============================================
+ Hits 63 67 +4
- Misses 67 70 +3 ☔ View full report in Codecov by Sentry. |
|
Thank you for working on this! Please send this against the |
|
Done |
Thank you. Please remove the commits cc73110 and c95c8b0 from your pull request as these must not go into the When I run the tests locally with your changes applied then I get Do you have an idea why that may be? |
4181a05 to
c535104
Compare
Somehow github added those by itself when changing the PRs merge base. I rebased the branch onto your changes from 8.0 from yesterday and undid github's mess up.
I do, and the reason for it is described in my last sentence of the PR, with the reason it fails now (but didn't fail previously) being the 2nd last sentence. As method description of
Since you didn't change the xdebug.mode setting at runtime with -d it wasn't returned anymore now. |
|
Thank you for the explanation. Do you want to make the test more robust or should I take care of that? |
|
Since it affects all the tests here and I still have lots of other pending PRs atm, I would appreciate if you could do it, since I'm not sure when I will have time to actually fix it and would be holding things up for quite some while otherwise. |
|
As strange as it may sound, I don't know how to improve these tests. This library is a collection of edge cases that continue to cut me. Do you have an idea? Thanks! |
|
Welcome to my life :-) Since I mostly handle and PR edge cases, I have this issue all the time and many repo's insistence on tests doesn't make it easier (sebastianbergmann/phpunit#5852 is a fix to fix just one example of these edge case scenarios) Anyway, in this specific case, the issue is:
Afair github actions/any CI allows specifying additional .ini files for PHP don't they? You could create 2 new .ini that are used in the CI, set values there (some only in 1 ini, some in both ini, some with Off, some with On, some with Off in both .ini, some with On in both ini, some with On in 1 ini) and then check the values of the ini + 1 value that is not in the ini whether they exist in array or not |
|
Superseded by #77. |