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

Unit Tests: Run under PHP 8.1, same as production #1457

Open
wants to merge 28 commits into
base: production
Choose a base branch
from

Conversation

dd32
Copy link
Member

@dd32 dd32 commented Feb 12, 2025

PR is for testing the github actions.

WordCamp.org has switched to PHP 8.1, so the unit tests should be running under the same environment.

There's likely more steps needed here.

dd32 and others added 28 commits February 12, 2025 12:54
`get_site_meta()` will return an empty string here when the value is not set or invalid input is provided, which is not acceptable to `in_array()`.

By setting it to an empty array in a falsy case, we avoid the fatal and retain previous behaviour.
This is in part due to composer.json making use of `post-update-cmd` which doesn't execute on install with a lock file present, only update or install without a lock file.
> ������������������������������������������������������Warning from https://repo.packagist.org: Support for Composer 1 will be shutdown on August 1st 2025. You should upgrade to Composer 2. See https://blog.packagist.com/shutting-down-packagist-org-support-for-composer-1-x/
The unit tests don't have the needed network sites setup, that's why this testcase class exists.
…ork setup, with the hard-coded blog_ids that WordCamp expects.
@@ -77,7 +77,9 @@ function fetch_unsafe_remote_css( $remote_css_url ) {
*/
function sanitize_unsafe_css( $unsafe_css ) {
if ( ! class_exists( 'Jetpack_Custom_CSS_Enhancements' ) ) {
if ( version_compare( JETPACK__VERSION, '11.6', '<' ) ) {
if ( version_compare( JETPACK__VERSION, '13.7.1', '>' ) ) {
return ''; // Custom CSS not included in Jetpack anymore.
Copy link
Member Author

Choose a reason for hiding this comment

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

This is obviously a big TODO; to replace the Jetpack CSS sanitization dependency with our own bundled here.
This is needed, and was one of the reasons for this PR in the first places.

This change should be reverted from the PR really.

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.

1 participant