WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/27/2016 08:35:16 AM (4 years ago)
Author:
wonderboymusic
Message:

Unit Tests:

  • Automatically delete objects that we were created during wpSetUpBeforeClass - posts, comments, terms (except 1), and user (except 1)
  • The amount of leftover data between tests was breathtaking - use the new function: _delete_all_data()
  • Commit database transactions for all TestCases, not just those that implement wpSetUpBeforeClass and wpTearDownAfterClass
  • The tests run 10-20 seconds faster now

See #37699.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/user/wpSetCurrentUser.php

    r35248 r38398  
    1212        self::$user_ids[] = self::$user_id = $factory->user->create();
    1313        self::$user_ids[] = self::$user_id2 = $factory->user->create( array( 'user_login' => 'foo', ) );
    14     }
    15 
    16     public static function wpTearDownAfterClass() {
    17         foreach ( self::$user_ids as $id ) {
    18             self::delete_user( $id );
    19         }
    2014    }
    2115
Note: See TracChangeset for help on using the changeset viewer.