Make WordPress Core


Ignore:
Timestamp:
10/07/2019 10:17:22 PM (5 years ago)
Author:
johnbillion
Message:

Pings/Trackbacks: Remove a failing test that won't pass as long as WP_IMPORTING gets set during tests.

The _publish_post_hook() function checks for WP_IMPORTING before setting meta fields fir enclosures and pings, which means this test is doomed to fail.

The test can be re-implemented if the WP_IMPORTING constant gets moved to a function similar to how wp_installing() works for the WP_INSTALLING constant.

See #48014

File:
1 edited

Legend:

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

    r46426 r46428  
    14311431        self::assertEquals( strtotime( gmdate( 'Y-m-d H:i:s' ) ), strtotime( $post->post_date_gmt ), 'The dates should be equal', 2 );
    14321432    }
    1433 
    1434     /**
    1435      * @ticket 48014
    1436      */
    1437     public function test_updated_post_should_not_duplicate_enclosure_meta_fields() {
    1438         $post_id = self::factory()->post->create();
    1439 
    1440         $encloseme_before = get_post_meta( $post_id, '_encloseme' );
    1441         $pingme_before    = get_post_meta( $post_id, '_pingme' );
    1442 
    1443         $updated = wp_update_post( get_post( $post_id ), true );
    1444 
    1445         $encloseme_after = get_post_meta( $post_id, '_encloseme' );
    1446         $pingme_after    = get_post_meta( $post_id, '_pingme' );
    1447 
    1448         $this->assertSame( $post_id, $updated );
    1449 
    1450         $this->assertCount( 1, $encloseme_before );
    1451         $this->assertCount( 1, $encloseme_after );
    1452 
    1453         $this->assertCount( 1, $pingme_before );
    1454         $this->assertCount( 1, $pingme_after );
    1455     }
    14561433}
Note: See TracChangeset for help on using the changeset viewer.