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

Migrate PHPUnit Tests and Use WordPress test lib instead of WP Mocks #1073

Draft
wants to merge 24 commits into
base: develop
Choose a base branch
from

Conversation

ravinderk
Copy link
Contributor

@ravinderk ravinderk commented Jun 9, 2023

🔴 This pull request is not ready for review.

Description of the Change

In a few cases, We found that Mocking WordPress (10UP\WP_Mock) for tests does not help to produce a reliable build. We decided to implement PHPUnit tests with WordPress.

Closes #

How to test the Change

  • Open the terminal and switch to the plugin root directory
  • Run composer install
  • Install WordPress and create a database tests/bin/install-wp-tests.sh distributor_tests root root
  • Run PHPUnit test vendor/bin/phpunit

Changelog Entry

Added - Migrate PHPUnit tests to WordPress from10UP/WP_Mock

Credits

Props @ravinderk

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@ravinderk ravinderk self-assigned this Jul 7, 2023
@jeffpaul jeffpaul added this to the 2.0.0 milestone Jul 10, 2023
@jeffpaul
Copy link
Member

@ravinderk any chance of getting this wrapped up in the next week or so to be ready for the v2 release?

@peterwilsoncc peterwilsoncc modified the milestones: 2.0.0, 2.0.1 Sep 6, 2023
@jeffpaul jeffpaul mentioned this pull request Sep 14, 2023
16 tasks
@peterwilsoncc peterwilsoncc modified the milestones: 2.0.1, 2.1.0 Sep 19, 2023
@github-actions github-actions bot added the needs:refresh This requires a refreshed PR to resolve. label Feb 9, 2024
# Conflicts:
#	tests/php/DistributorPostTest.php
#	tests/php/NetworkSiteConnectionsTest.php
#	tests/php/WordPressExternalConnectionTest.php
#	tests/php/bootstrap.php
@github-actions github-actions bot removed the needs:refresh This requires a refreshed PR to resolve. label Feb 11, 2024
@ravinderk ravinderk removed their assignment Feb 21, 2024
@github-actions github-actions bot added the needs:refresh This requires a refreshed PR to resolve. label Feb 29, 2024
Copy link

@ravinderk thanks for the PR! Could you please rebase your PR on top of the latest changes in the base branch?

@jeffpaul
Copy link
Member

jeffpaul commented Jul 8, 2024

@10up/open-source-practice this would be a good PR to help pick up and get finished off

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs:refresh This requires a refreshed PR to resolve.
Projects
Status: Code Review
Development

Successfully merging this pull request may close these issues.

None yet

3 participants