Make WordPress Core


Ignore:
Timestamp:
08/27/2016 08:35:16 AM (7 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/feed/rss2.php

    r36519 r38398  
    4545
    4646    /**
    47      * Destroy the user we created and related posts.
    48      */
    49     public static function wpTearDownAfterClass() {
    50         // Delete our user
    51         self::delete_user( self::$user_id );
    52 
    53         // Delete all of our posts
    54         foreach ( self::$posts as $post ) {
    55             wp_delete_post( $post, true );
    56         }
    57 
    58         // Delete our taxonomy
    59         wp_delete_category( self::$category->term_id );
    60     }
    61 
    62     /**
    6347     * Setup.
    6448     */
Note: See TracChangeset for help on using the changeset viewer.