Make WordPress Core

Changeset 64105


Ignore:
Timestamp:
10/05/2026 06:51:55 PM (2 weeks ago)
Author:
lancewillett
Message:

Tests: Document post object value comparisons.

Explain why the sample permalink tests retain assertEquals() when checking that the original WP_Post properties remain unchanged.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13993

Props noruzzaman.
See #64895.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/admin/includesPost.php

    r63934 r64105  
    968968                        'get_sample_permalink',
    969969                        function ( $permalink, $post_id, $title, $name, $post ) use ( $post_original ) {
     970                                // Keep assertEquals() because the objects are intentionally compared by value.
    970971                                $this->assertEquals( $post_original, $post, 'Modified post object passed to get_sample_permalink filter.' );
    971972                                return $permalink;
    … …  
    976977
    977978                get_sample_permalink( $post );
     979                // Keep assertEquals() because the objects are intentionally compared by value.
    978980                $this->assertEquals( $post_original, $post, 'get_sample_permalink() modifies the post object.' );
    979981        }
Note: See TracChangeset for help on using the changeset viewer.