Repository navigation
Tests: Ensure embed template JS fixtures exist for oembed isolation - #14828
Draft
shail-mehta wants to merge 1 commit into
Draft
shail-mehta wants to merge 1 commit into
shail-mehta wants to merge 1 commit into
Conversation
Touch wp-emoji-loader.js and wp-embed-template.js in set_up so oembed template tests pass when the directory runs alone.
There was a problem hiding this comment.
🟢 Approval recommended
The focused test-only change uses the existing fixture helper consistently, with no blocking issues identified; runtime tests were not executed.
No open issues 🎉
What changed in this PR
This PR makes embed template tests independent of suite execution order by ensuring required JavaScript fixtures exist in shared setup.
Changes:
- Creates the emoji loader fixture in
set_up(). - Moves embed template fixture creation from one test into
set_up()so all tests receive it.
| File | Description |
|---|---|
tests/phpunit/tests/oembed/template.php |
Ensures both JavaScript fixtures exist before each embed template test. |
Review effort: Balanced
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.
Trac ticket: #65893
What
Ensures required JS assets exist in
Tests_Embed_Template::set_up()intests/phpunit/tests/oembed/template.php.Why
Embed template tests load
theme-compat/embed.php, which prints emoji detection scripts. Those assumewp-includes/js/wp-emoji-loader.js(andwp-embed-template.js) exist. When other suites run first they may already have created those files; whenoembed/runs alone,file_get_contents()fails.How
self::touch()forwp-emoji-loader.jsandwp-embed-template.jsinset_up().wp-embed-template.jstouch out of a single test so every embed template test gets the fixtures.Testing Instructions
npm run env:start && npm run env:install.npm run test:php -- --test-suffix .php tests/phpunit/tests/oembed --order-by=random --random-order-seed=1npm run test:php -- --test-suffix .php tests/phpunit/tests/oembed --order-by=random --random-order-seed=2npm run test:php -- --test-suffix .php tests/phpunit/tests/oembedOK.Use of AI Tools