Make WordPress Core


Ignore:
Timestamp:
01/03/2026 06:15:57 AM (3 months ago)
Author:
westonruter
Message:

Code Modernization: Update tests to use null coalescing operator in place of isset() in ternaries.

Developed as a subset of https://github.com/WordPress/wordpress-develop/pull/10654

Follow-up to [61404], [61403].

See #58874, #63430.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/post/thumbnails.php

    r59235 r61424  
    288288     */
    289289    public function test__wp_preview_post_thumbnail_filter() {
    290         $old_post = isset( $GLOBALS['post'] ) ? $GLOBALS['post'] : null;
     290        $old_post = $GLOBALS['post'] ?? null;
    291291
    292292        $GLOBALS['post']           = self::$post;
     
    308308     */
    309309    public function test__wp_preview_post_thumbnail_filter_secondary_post() {
    310         $old_post = isset( $GLOBALS['post'] ) ? $GLOBALS['post'] : null;
     310        $old_post = $GLOBALS['post'] ?? null;
    311311
    312312        $secondary_post = self::factory()->post->create(
Note: See TracChangeset for help on using the changeset viewer.