php unit test changes to address issues that php7.4 will report#36586
Conversation
Codecov Report
@@ Coverage Diff @@
## master #36586 +/- ##
=========================================
Coverage 64.87% 64.87%
Complexity 19146 19146
=========================================
Files 1269 1269
Lines 74947 74947
Branches 1331 1331
=========================================
Hits 48625 48625
Misses 25930 25930
Partials 392 392
Continue to review full report at Codecov.
|
c5a8a3b to
a2da02b
Compare
a2da02b to
83044a0
Compare
18256b4 to
388c14e
Compare
|
@DeepDiver1975 or whoever cares to give review/feedback on this - these are things that are reported by Does the way I have adjusted things in this PR make sense? If so, then we could merge this, and then "someone" can be tasked to adjust the rest of the issues "someday". |
98ef2aa to
81ca245
Compare
|
@DeepDiver1975 @micbar or anybody - is this the right way to adjust these unit tests? If so, then this is an example for when we really get working on PHP 7.4 support. It could be merged now - this all works with PHP 7.1 7.2 7.3 |
81ca245 to
15268b3
Compare
|
Rebased just now to get new |
15268b3 to
0c1b77a
Compare
|
@jvillafanez here is some changes for supporting PHP 7.4. This seems to be the sort of stuff we need to do. PR #37004 runs CI with PHP 7.4 to see what it reports (there are plenty more things to adjust) |
0c1b77a to
9b69c43
Compare
9b69c43 to
0ccd1ee
Compare
767fa78 to
6f4776d
Compare
|
@micbar @DeepDiver1975 @jvillafanez @VicDeo or anyone. |
|
The cleanup in the cache should be moved to the tear down function, but taking into account the previous code, I'm fine with these changes. 👍 |
…rray offset on value of type bool'
…array offset on value of type bool'
6f4776d to
0434cca
Compare
@jvillafanez did you mean that I can leave the code as I have written it, or that you want me to refactor code into the teardown function? |
|
Up to you. Technically, this PR is to fix php 7.4 issues, so the tear down problem is out of the scope. You can open a new PR to fix that problem, or if it's easier for you (and the amount of changes are controlled) you can fix it here. |
|
The code like: Is followed by existing asserts like: So the cache remove code is not "just" cleanup at the moment. That could all be sorted out (e.g. why are those @micbar @DeepDiver1975 @jvillafanez @VicDeo or anyone. Please review. |
I am finding things in the unit tests that PHP7.4 complains about (PR #36500 )
Also put them here to see that the fixes/changes still pass with an older version(s) of PHP 7.1 7.2 7.3
ControllerMethodReflector.phpwe will not be able to "just cast to string", use thegetName()method.$patternmight look like something other than a string. Cast it to string because we really want it to be a string.instance->remove('hack')complained because actually hack does not always exits. Only remove it if it still exists.SignAppTestandSignCoreTestto fix 'Trying to access array offset on value of type bool' - the mocking was not actually reading in the test key and crt files. Somehow the test was passing with the privateKey being literallyprivateKeyand the certificate being the literal stringcertificate