Make WordPress Core


Ignore:
Timestamp:
09/19/2020 11:11:00 AM (6 years ago)
Author:
SergeyBiryukov
Message:

Tests: Speed up slashed data tests by reusing some more shared fixtures.

Follow-up to [35249], [49003].

See #51344.

File:
1 edited

Legend:

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

    r49004 r49005  
    88class Tests_Post_Slashes extends WP_UnitTestCase {
    99    protected static $author_id;
     10    protected static $post_id;
    1011
    1112    public static function wpSetUpBeforeClass( $factory ) {
    1213        self::$author_id = $factory->user->create( array( 'role' => 'editor' ) );
     14        self::$post_id   = $factory->post->create();
    1315    }
    1416
     
    3335     */
    3436    function test_edit_post() {
    35         $post_id = self::factory()->post->create();
     37        $post_id = self::$post_id;
    3638
    3739        $_POST               = array();
     
    106108     */
    107109    function test_wp_update_post() {
    108         $post_id = self::factory()->post->create();
     110        $post_id = self::$post_id;
    109111
    110112        wp_update_post(
Note: See TracChangeset for help on using the changeset viewer.