Skip to content
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

phpunit version check error returns two failed tests #11

Open
withanage opened this issue Mar 7, 2024 · 3 comments
Open

phpunit version check error returns two failed tests #11

withanage opened this issue Mar 7, 2024 · 3 comments

Comments

@withanage
Copy link
Member

withanage commented Mar 7, 2024

Bug

phpunit version creates 2 errors:

1) PKPComponentRouterTest::testGetRequestedContextPathWithInvalidLevel
Undefined array key 1

/home/runner/ojs/lib/pkp/classes/core/PKPRouter.inc.php:218
/home/runner/ojs/lib/pkp/tests/classes/core/PKPRouterTestCase.inc.php:93

2) PKPPageRouterTest::testGetRequestedContextPathWithInvalidLevel
Undefined array key 1

/home/runner/ojs/lib/pkp/classes/core/PKPRouter.inc.php:218
/home/runner/ojs/lib/pkp/tests/classes/core/PKPRouterTestCase.inc.php:93

It seems that the PHPUnit version check doesn't match the PHP version. In OJS 3.3, we're using PHPUnit 9.5, which is causing the tests to fail. A more consistent approach would be to verify the PHPUnit version.

Vendor Information

sebastianbergmann/phpunit#5062

@withanage withanage changed the title pphpunit version check error fails2 two tests phpunit version check error fails2 two tests Mar 7, 2024
@withanage withanage changed the title phpunit version check error fails2 two tests phpunit version check error returns two failed tests Mar 7, 2024
withanage added a commit to withanage/pkp-lib that referenced this issue Mar 8, 2024
withanage added a commit to withanage/pkp-lib that referenced this issue Mar 9, 2024
withanage added a commit to withanage/pkp-lib that referenced this issue Mar 9, 2024
withanage added a commit to withanage/ojs that referenced this issue Mar 9, 2024
withanage added a commit to withanage/ojs that referenced this issue Mar 9, 2024
withanage added a commit to withanage/ojs that referenced this issue Mar 10, 2024
withanage added a commit to withanage/ojs that referenced this issue Mar 10, 2024
withanage added a commit to withanage/ojs that referenced this issue Mar 11, 2024
@withanage
Copy link
Member Author

Hi @asmecher ,

I have in OJS 3.3 github actions the issue, that the above tests fai for php 8.0+, cause it assumes that the php version shoud be larger,

https://github.com/pkp/pkp-lib/pull/9788/files

But this seems to me like, it is related to the phpunit 10 support, which drops expectError()

However after my change of assuming a larger phpunit version, travis tests for ojs 3.3. , 8.0+ fails, what I think is a valiadtion error.
https://app.travis-ci.com/github/pkp/ojs/builds/269371762

I tested my change with GA https://github.com/withanage/ojs/actions/runs/8189570913
and it seems to work.

I am a little unsure there, could you take a look ?

@asmecher
Copy link
Member

I might be missing the point -- I haven't gone into this deeply -- but wouldn't it make sense to check both the PHP version and phpunit version? Obviously if PHPUnit doesn't have expectError it shouldn't be used -- but also I think this is a case where something that was previously a warning got promoted to an error with a new version of PHP. So perhaps both should be checked.

@withanage
Copy link
Member Author

Yes, it colud be the proecess of Thanks Alec, restricting both would be better and stop travis tests from braking too.

withanage added a commit to withanage/ojs that referenced this issue Apr 13, 2024
withanage added a commit to withanage/ojs that referenced this issue Apr 13, 2024
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

No branches or pull requests

2 participants