Misc test fixes#577
Open
swissspidy wants to merge 7 commits into
Open
Conversation
swissspidy
marked this pull request as ready for review
July 16, 2026 12:34
There was a problem hiding this comment.
Pull request overview
Updates AMP-related test fixtures and URL rewriting logic to handle multiple AMP cache hosts (notably ampjs.org) and stabilizes test inputs/outputs across the suite.
Changes:
- Update AMP video test fixtures to use a more stable Big Buck Bunny MP4 URL.
- Extend AMP cache host handling to recognize and rewrite both
cdn.ampproject.organdampjs.org, and update RewriteAmpUrls expected outputs (including preloads). - Refresh runtime fallback metadata, align PHPCompatibility checks with the project’s PHP minimum, and adjust CI workflow triggering behavior.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/spec/valid-amp/files/Rich_Media_Notifications.html | Switches amp-video src to a new sample video host. |
| tests/spec/valid-amp/files/amp-video.html | Updates multiple amp-video src occurrences to the new sample URL. |
| tests/spec/valid-amp/files/amp-ima-video.html | Updates IMA video sources/data-src to the new sample URL. |
| tests/spec/valid-amp/files/Advanced_Video_Docking.html | Updates amp-video src to the new sample URL. |
| tests/spec/transformers/valid/RewriteAmpUrls/adds_preloads_ampjs/expected_output.html | Updates expected rewritten AMP URLs and adds expected preload links. |
| tests/spec/transformers/valid/RewriteAmpUrls/adds_lts_ampjs/expected_output.html | Updates expected LTS rewritten AMP URLs and adds expected preload links. |
| tests/AmpTest.php | Expands runtime-script detection tests to include https://ampjs.org/v0.js. |
| src/Optimizer/Transformer/RewriteAmpUrls.php | Treats multiple AMP cache hosts as rewriteable inputs. |
| src/Amp.php | Introduces CACHE_HOSTS list and extends runtime/viewer script detection to multiple hosts. |
| resources/local_fallback/rtv/metadata | Updates embedded runtime/CSS version metadata for local fallback. |
| composer.json | Updates PHPCompatibility test target version to 7.4 (matching minimum supported PHP). |
| .github/workflows/test.yml | Removes the if: guard from the unit-test job (changes when CI runs). |
Comments suppressed due to low confidence (1)
src/Amp.php:74
- Amp::CACHE_HOSTS now allows both cdn.ampproject.org and ampjs.org, but CACHE_ROOT_URL is still hard-coded to the cdn host. Call sites that gate on CACHE_ROOT_URL (e.g. AutoExtensions.php:197 and Html/Parser/ScriptTag.php:219) will still ignore ampjs.org URLs, leading to inconsistent behavior depending on which code path is used.
* URL of the AMP cache.
*
* @var string
*/
const CACHE_ROOT_URL = self::CACHE_HOST . '/';
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
184
to
+188
| if (strpos($url, $host) === 0) { | ||
| return $url; | ||
| } | ||
|
|
||
| foreach (Amp::CACHE_HOSTS as $cacheHost) { |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
No description provided.