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

Add missing theme-compat path check. #5634

Closed

Conversation

mukeshpanchal27
Copy link
Member

@mukeshpanchal27 mukeshpanchal27 commented Nov 8, 2023

Trac ticket:

Followup for #18298 / [56635]

While I was working on another ticket, I came across this issue.

When i run unit test for test_switch_theme using npm run test:php -- --filter test_switch_theme i found that it show me below error. They error comes from the TT4 theme, the tests did not run checks for block theme per this line of code but when we run single unit test current_theme_supports( 'block-templates' ) return false due to some global updates in other unit tests.

Error:

1) Tests_Theme::test_switch_theme
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-''
+'/var/www/src/wp-includes/theme-compat/footer.php'

This PR add the missing theme-compat check similar to locate_template function so it will not failed.


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

Copy link
Member

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

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

@mukeshpanchal27 Good catch, makes sense to include this as a safety net.

They error comes from the TT4 theme, the tests did not run checks for block theme per this line of code but when we run single unit test current_theme_supports( 'block-templates' ) return false due to some global updates in other unit tests.

This is probably still an issue though, so it would be great to figure out where that global test "pollution" comes from.

@mukeshpanchal27
Copy link
Member Author

mukeshpanchal27 commented Nov 9, 2023

Thanks @felixarntz, I have open separate PR 5646 in which we can check the switch_theme behaviour. Meantime could you commit this one?

@felixarntz
Copy link
Member

@mukeshpanchal27 I've looked into the problem as well and implemented #5650 as an attempt. Can you try applying that to your site (without this PR here though) and see if that would address the failure with TT4 as well?

@felixarntz
Copy link
Member

Closing in favor of https://core.trac.wordpress.org/changeset/57104

@felixarntz felixarntz closed this Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants