WordPress.org

Make WordPress Core

Ticket #47704: 47704-Tests_Query_GeneratePostdat.patch

File 47704-Tests_Query_GeneratePostdat.patch, 908 bytes (added by jrf, 6 months ago)

PHP 7.4/array-access: Fix Tests_Query_GeneratePostdata::test_setup_by_fake_post() - fixes 1 faulty unit test

  • tests/phpunit/tests/query/generatePostdata.php

    From 32c4a8565276d747bf5d7d3c083256f3661101c2 Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Mon, 15 Jul 2019 00:58:35 +0200
    Subject: [PATCH] PHP 7.4/array-access: Fix
     Tests_Query_GeneratePostdata::test_setup_by_fake_post()
    
    ---
     tests/phpunit/tests/query/generatePostdata.php | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/tests/phpunit/tests/query/generatePostdata.php b/tests/phpunit/tests/query/generatePostdata.php
    index 20525ee9d3..fa7d0afb46 100644
    a b class Tests_Query_GeneratePostdata extends WP_UnitTestCase { 
    2424                $data     = generate_postdata( $fake->ID );
    2525
    2626                // Fails because there's no post with this ID.
    27                 $this->assertNotSame( $fake->ID, $data['id'] );
     27                $this->assertFalse( $data );
    2828        }
    2929
    3030        /**