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

Fixing the broken tests #15

Open
pacoorozco opened this issue Feb 28, 2023 · 0 comments
Open

Fixing the broken tests #15

pacoorozco opened this issue Feb 28, 2023 · 0 comments

Comments

@pacoorozco
Copy link

pacoorozco commented Feb 28, 2023

Hi @guilhermegonzaga

I've been taking a look to the broken test and I would like to suggest you how to fix it.

The GitHub action running your tests is configured to use the Ubuntu latest image and the default PHP version there.

Before Ubuntu 22.04, the default PHP version was 7.x and your tests were passing.

Then, GitHub started to use Ubuntu 22.04 and the default PHP version is 8.0. When you run your tests (using PHPUnit v5) they try to use a function that has been removed from PHP (the each()). And by this, the tests are broken.

How to fix it

There are several ways, let me suggest the one that I believe is the best.

  1. Create a branch of the current code (eg. 1.x)
  2. This branch will use PHP up to 7.x to run tests (I recommend to setup a new GHA for this branch)
  3. The master branch will use the current GHA version
  4. You need to refactor de test to be compliant with PHPUnit 9.x. It's really easy and I can submit a PR 😄

The branch and tag v1.x will be used for Laravel versions up to 8.

The master branch and maybe tag v2.x can be used for Laravel versions 9 and 10, which use PHP 8.x

What do you think?

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

1 participant