-
Notifications
You must be signed in to change notification settings - Fork 156
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
base: develop
Are you sure you want to change the base?
Conversation
2213e43
to
0d92a13
Compare
0d92a13
to
9ab17f5
Compare
@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
@10up/open-source-practice this would be a good PR to help pick up and get finished off |
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? |
* | ||
* @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 = [] ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 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 install
tests/bin/install-wp-tests.sh distributor_tests root root
vendor/bin/phpunit
Changelog Entry
Credits
Props @ravinderk
Checklist: