Skip to content

Test enhancement #213

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

Closed
wants to merge 1 commit into from
Closed

Conversation

peter279k
Copy link

Changed log

  • Update PHPUnit version to be ^4.8.36 to prepare for latest stable PHP version.
  • Using the c;ass-based PHPUnit namespace.
  • Using the psr-4 to load the required classes automatically.
  • According to the PHPUnit fixtures reference, the setUp method should be protected, not public.

@Zegnat Zegnat mentioned this pull request May 2, 2020
@tantek tantek requested review from aaronpk and Zegnat May 21, 2020 19:28
Copy link
Member

@tantek tantek left a comment

Choose a reason for hiding this comment

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

Given the comment in #220 : #220 (comment) regarding PHPUnit 5, does it help to do this intermediate change, or should this pull request be updated for PHPUnit 5 before merging? Have requested review from @Zegnat accordingly (feel free to pull in additional reviewers like folks that worked on #220 accordingly). Thanks!

@Lewiscowles1986
Copy link
Contributor

I feel like if this were updated and the bump to PHPUnit 5 made separately, it would help avoid dual changes in a single PR. @peter279k has contributed to other PHP projects and I have found them a pleasure to work with,

This already has conflicts, so should hold off on rebase until @Zegnat work merges, at which point some of this I think may become redundant or need fresh approach.

Could be multiple PR's in this as right now it is changing a lot.

@Zegnat
Copy link
Member

Zegnat commented Sep 19, 2020

Yikes, this issue somehow ended up way long down my review list. Apologies @peter279k!

I think what we want to do now that php-mf2 has moved to being PHP 5.6+ is to completely update PHP Unit to something like:

-         "phpunit/phpunit": "4.8.*",
+        "phpunit/phpunit": "^5.0 || ^8.0",

If possible for our test cases, that is.

PHPUnit 5 has long fallen out of support but was the last version to officially run on PHP 5.6. PHPUnit 8 is still supported until 2021 and runs on PHP 7.2 to PHP 7.4. Older versions pre PHP 7.2 can use PHPUnit 5. (Information per PHPUnit's Supported Versions page).

This probably also enables some of the class based changes to the tests. As we are able to completely leave PHPUnit 4 behind.

What do you think @peter279k? Is that a change you would like to work on in this PR, or should we see if someone else wants to pick it up?

For those who work on other projects that support PHP 5.6, like @dshanske, any advice on how tests are usually set up to test such a wide span of PHP versions?

@peter279k
Copy link
Author

Yikes, this issue somehow ended up way long down my review list. Apologies @peter279k!

I think what we want to do now that php-mf2 has moved to being PHP 5.6+ is to completely update PHP Unit to something like:

-         "phpunit/phpunit": "4.8.*",
+        "phpunit/phpunit": "^5.0 || ^8.0",

If possible for our test cases, that is.

PHPUnit 5 has long fallen out of support but was the last version to officially run on PHP 5.6. PHPUnit 8 is still supported until 2021 and runs on PHP 7.2 to PHP 7.4. Older versions pre PHP 7.2 can use PHPUnit 5. (Information per PHPUnit's Supported Versions page).

This probably also enables some of the class based changes to the tests. As we are able to completely leave PHPUnit 4 behind.

What do you think @peter279k? Is that a change you would like to work on in this PR, or should we see if someone else wants to pick it up?

For those who work on other projects that support PHP 5.6, like @dshanske, any advice on how tests are usually set up to test such a wide span of PHP versions?

Thanks for your reply.

I will do that at my available time.

@Lewiscowles1986
Copy link
Contributor

@peter279k I have some experience with using yoast polyfill so that PHPunit is brought in via indirection. Do you think that could help with this? Do you have experience of this? Should this be closed?

@Zegnat not sure if above applies to you too?

Happy to make a new patch request if that seems preferable?

@peter279k
Copy link
Author

I almost forgot this PR. It's outdated and there're many conflict in this PR.

I will close the PR. Please feel free to create new PR for that, @Lewiscowles1986.

And we can find what the proper way is for this test improvements.

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.

4 participants