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

[Feature] Unit tests for the Full-Page Caching for 404s feature #76

Merged

Conversation

renatonascalves
Copy link
Contributor

@renatonascalves renatonascalves commented Feb 13, 2024

Summary

As titled.

Notes for reviewers

See #46

@renatonascalves renatonascalves self-assigned this Feb 13, 2024
@renatonascalves renatonascalves requested a review from a team as a code owner February 13, 2024 01:14
@renatonascalves
Copy link
Contributor Author

Looks like the php-cs-fixer doesn't like the <<<HTML indentation. But I could not make it work. 🤔

@renatonascalves
Copy link
Contributor Author

I made it work but it seems we have conflicting tools here asking for different rules: php-cs-fixer vs phpcs.

@renatonascalves
Copy link
Contributor Author

renatonascalves commented Feb 13, 2024

Getting the object-cache to work here is proving more complicated than expected. Moving on as it is for now while I search for better support. Probably changing https://github.com/alleyinteractive/.github/blob/main/.github/workflows/php-tests.yml

Copy link
Member

@kevinfodness kevinfodness left a comment

Choose a reason for hiding this comment

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

A few suggestions, but no blockers - good addition to the test suite 🍣

$url = home_url( self::TEMPLATE_GENERATOR_URI, 'https' );

// Replace http with https to ensure the styles don't get blocked due to insecure content.
$url = str_replace( 'http://', 'https://', $url );

// This request will populate the cache using output buffering.
if ( function_exists( 'wpcom_vip_file_get_contents' ) ) {
if ( \function_exists( 'wpcom_vip_file_get_contents' ) ) {
Copy link
Member

Choose a reason for hiding this comment

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

Why is the slash being added here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is being added by the php-cs-fixer. Not sure yet why.

composer.json Outdated Show resolved Hide resolved
@renatonascalves renatonascalves merged commit f628f26 into feature/9/caching-404s Feb 14, 2024
9 checks passed
@renatonascalves renatonascalves deleted the feature/9/caching-404s-unit-tests branch February 14, 2024 23:44
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