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

Update failing tests after new transient in WP core #97

Merged
merged 1 commit into from Apr 26, 2024

Conversation

petitphp
Copy link
Contributor

This PR update transient feature tests to handle the new theme pattern transient wp_theme_files_patterns.

Fixes #95

@petitphp petitphp requested a review from a team as a code owner April 26, 2024 13:17
@swissspidy
Copy link
Member

Looks like there are still some failing tests.

What's with the WP_DEVELOPMENT_MODE addition? From what I can see in the commit, the transient is added regardless of the development mode setting.

@petitphp
Copy link
Contributor Author

petitphp commented Apr 26, 2024

The method set_pattern_cache which internally set the transient is only called if not in development mode : wp-includes/class-wp-theme.php#L1853-L1855

if ( $can_use_cached ) {
	$this->set_pattern_cache( $pattern_data );
}

@swissspidy
Copy link
Member

Got it! In that case let's add a comment on these lines explaining what it does and why it is added.

An alternative would be to create a new test for 6.6+, but that is probably overkill.

@petitphp
Copy link
Contributor Author

Will update the PR with comments. I'm also looking at tests that fail with MySQL 5.x

Copy link
Member

@swissspidy swissspidy left a comment

Choose a reason for hiding this comment

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

Seems to work now!

Current SQLite failures are known, see #92

@swissspidy swissspidy added this to the 2.2.0 milestone Apr 26, 2024
@swissspidy swissspidy merged commit 1dbb59e into wp-cli:main Apr 26, 2024
27 of 38 checks passed
@petitphp petitphp deleted the fix/failing-tests-wp66 branch April 26, 2024 14:54
@swissspidy
Copy link
Member

Just noting this was merged during the hack day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update trunk tests to accommodate for new transient in core
2 participants