This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 219
Filter data count mismatch > Fix PHP unit tests #8984
Merged
Merged
Conversation
This file contains 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
…ault list with all terms (with count equal zero) is returned instead.
… filter attributes and the condition query for 'and'
… rely on the new get_attribute_and_meta_counts method instead.
…tical attributes, they are counted once.
…n the macro query if they are not empty.
… new get_product_by_filtered_terms method.
… the min_price and max_price format on get_product_by_metas.
… one of the filtered terms and update the macro query to include those term ids on the WHERE clause.
…API request to correctly fetch the attribute count data.
…t one of the metas in the request is not empty.
…e count zero are not displayed.
woocommercebot
requested review from
a team and
thealexandrelara
and removed request for
a team
April 7, 2023 16:09
The release ZIP for this PR is accessible via:
Script Dependencies ReportThere is no changed script dependency between this branch and trunk. This comment was automatically generated by the TypeScript Errors Report
🎉 🎉 This PR does not introduce new TS errors. |
nefeline
added
skip-changelog
PRs that you don't want to appear in the changelog.
block: filter by attribute
Issues related to the Filter by Attribute block.
category: tests
labels
Apr 7, 2023
Size Change: 0 B Total Size: 1.1 MB ℹ️ View Unchanged
|
9 tasks
roykho
approved these changes
Apr 7, 2023
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.
Tested and no more errors. Good job!
Bumping to 10.1.0 milestone after p1681128984753939/1681128388.500929-slack-C02UBB1EPEF |
…unit-tests-attribute-counts
…unit-tests-attribute-counts
Base automatically changed from
add/get-attribute-and-meta-counts-method
to
trunk
April 11, 2023 15:32
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
block: filter by attribute
Issues related to the Filter by Attribute block.
skip-changelog
PRs that you don't want to appear in the changelog.
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.
Following up on the work done on #8599, the changes introduced on this PR ensure the PHP Unit tests are successful for the updated
get_attribute_counts
method.The main reason why the tests started to fail with the changes made on #8599 is that we are now relying on the
{wpdb->prefix}_wc_product_attributes_lookup
table for fetching the counts, and there was no fixture data to support it.Additionally, since
assertObjectHasAttribute
is deprecated, it was replaced with$this->assertTrue( property_exists( $property_name, 'term' ) );
instead.Testing
Automated Tests
User Facing Testing
npm run test:php
locally and ensure everything is working as expected as well.WooCommerce Visibility