Skip to content

Investigate broken test against WordPress trunk #3327

@swissspidy

Description

@swissspidy

There is currently one test failure on PHP 7.3 / WordPress trunk:

1) Test_AMP_Validated_URL_Post_Type::test_render_post_filters
json_encode() expects parameter 2 to be int, array given

/tmp/wordpress/src/wp-includes/functions.php:3733
/tmp/wordpress/src/wp-content/plugins/amp/tests/php/validation/test-class-amp-validated-url-post-type.php:1361

Looks like the wp_json_encode call there is actually wrong as it passes an arbitrary int as the $options argument.

$validation_error_term = self::factory()->term->create(
[
'taxonomy' => AMP_Validation_Error_Taxonomy::TAXONOMY_SLUG,
'description' => wp_json_encode( [ 'code' => 'test' ], compact( 'i' ) ),
]
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions