Skip to content

Add support for Laravel 9.x #20

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 4 commits into from
Feb 16, 2022
Merged

Conversation

eduardlleshi
Copy link
Contributor

@eduardlleshi eduardlleshi commented Feb 11, 2022

@gauravmak I've made the changes to support the newest major version of Laravel. While running tests locally I was prompted to update phpunit.xml to the new standard format, so I did that too.

Also updated the Action to include testing for PHP 8.1

composer.json Outdated
Comment on lines 11 to 12
"orchestra/testbench": "^6.0.0"
"orchestra/testbench": "^6.0.0|^7.0.0"
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

-        "orchestra/testbench": "^6.0.0|^7.0.0"
+        "orchestra/testbench": "^7.0.0"

Do this and it works.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm against this change.

v7.x of testbench requires PHP ^8.0, so if we make that change this package would not support PHP < 8 anymore.

@gauravmak thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

It is a require-dev dependency. We will need PHP 8 during development to run tests. The package can still support older versions of PHP.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm pretty sure the Github workflow will fail for PHP < 8 if we removed that. Should we also update the test to drop checks for PHP < 8?

Copy link
Collaborator

@hirenkeraliya hirenkeraliya Feb 15, 2022

Choose a reason for hiding this comment

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

-        "orchestra/testbench": "^6.15.1",
+        "orchestra/testbench": "^6.23|^7.0.0",

You need to do this. Check it's working.

Copy link
Contributor Author

@eduardlleshi eduardlleshi Feb 15, 2022

Choose a reason for hiding this comment

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

^6.15.1 is working fine and all tests run successfully with --prefer-lowest flag.

Composer will decide which version of orchestra/testbench to install.
If --prefer-lowest flag is set it will install v6.0.0.
Otherwise if --prefer-stable is set (which is by default) it will install v6.24.1 (whatever the latest 6.x version is).

The change you are requesting doesn't have any impact at all, so I fail to understand the reason behind it.

I'm not being pushy, I just want to get some clarification on why we need to change it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

As per your note on description Side note: I tried to get PHP 8.1 support as well, but the action is failing to run the test using --prefer-lowest option. The package is working as intended on 8.1, but the tests cases are failing. I think the tests need to be re-written to support PHPUnit ^9.5.

I tried and it's throwing an error so I suggest you do this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I see. That's more complicated than that though.

PHPUnit ^9.5 is needed for PHP 8.1, but the tests are not compatible with PHPUnit ^9.5. We'd have to re-write the tests to get support for 8.1 (and be backward compatible with 7.3). I don't have the capability to handle that right now.

Copy link
Collaborator

Choose a reason for hiding this comment

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

there is no issue with the PHPUnit versions because as per the https://github.com/sebastianbergmann/phpunit/blob/master/composer.json#L25 they did not need more than or equal PHP 8.1.

There is an issue is with the orchestra/testbench because one of the dependencies of this package is not updated so we need to update this package to the 6.23 version. after this, all the tests are passed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hirenkeraliya you were right, setting testbench to at least 6.23 fixed the tests for PHP 8.1. Appreciate your input.

@gauravmak tests are passing on my branch. Can you start tests on this PR and merge it (if everything looks good)?

composer.json Outdated
Comment on lines 11 to 12
"orchestra/testbench": "^6.0.0"
"orchestra/testbench": "^6.0.0|^7.0.0"
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

there is no issue with the PHPUnit versions because as per the https://github.com/sebastianbergmann/phpunit/blob/master/composer.json#L25 they did not need more than or equal PHP 8.1.

There is an issue is with the orchestra/testbench because one of the dependencies of this package is not updated so we need to update this package to the 6.23 version. after this, all the tests are passed.

@gauravmak gauravmak merged commit 95a97c4 into freshbitsweb:master Feb 16, 2022
@gauravmak
Copy link
Member

Done. Thank you for your contribution, Eduard. 🙂

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.

3 participants