Migrate PHPUnit Tests and Use WordPress test lib instead of WP Mocks#1073
Draft
Migrate PHPUnit Tests and Use WordPress test lib instead of WP Mocks#1073
Conversation
2213e43 to
0d92a13
Compare
0d92a13 to
9ab17f5
Compare
Member
|
@ravinderk any chance of getting this wrapped up in the next week or so to be ready for the v2 release? |
# Conflicts: # tests/php/DistributorPostTest.php # tests/php/NetworkSiteConnectionsTest.php # tests/php/WordPressExternalConnectionTest.php # tests/php/bootstrap.php
Member
|
@10up/open-source-practice this would be a good PR to help pick up and get finished off |
Contributor
|
Update:
Note: I'm not assigning this to myself to allow others to pick it up and work on the remaining files |
|
@ravinderk thanks for the PR! Could you please rebase your PR on top of the latest changes in the base branch? |
Comment on lines
-30
to
-48
| * | ||
| * @method bool has_blocks() | ||
| * @method bool has_block( string $block_name ) | ||
| * @method int get_the_ID() | ||
| * @method string get_permalink() | ||
| * @method string get_post_type() | ||
| * @method int|false get_post_thumbnail_id() | ||
| * @method string|false get_post_thumbnail_url( string $size = 'post-thumbnail' ) | ||
| * @method string|false get_the_post_thumbnail( string $size = 'post-thumbnail', array $attr = '' ) | ||
| * @method string get_canonical_url( string $canonical_url = '' ) | ||
| * @method string get_author_name( string $author_name = '' ) | ||
| * @method string get_author_link( string $author_link = '' ) | ||
| * @method array get_meta() | ||
| * @method array get_terms() | ||
| * @method array get_media() | ||
| * @method array post_data() | ||
| * @method array to_insert( array $args = [] ) | ||
| * @method array to_pull_list( array $args = [] ) | ||
| * @method array to_rest( array $args = [] ) |
Collaborator
There was a problem hiding this comment.
This block is required to allow IDEs and docblock parsers to pick up the methods. They are all marked private so we can use a magic method to call them after ensuring the correct site is current on multisite.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔴 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
composer installtests/bin/install-wp-tests.sh distributor_tests root rootvendor/bin/phpunitChangelog Entry
Credits
Props @ravinderk
Checklist: