Make WordPress Core


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

    r38382 r38398  
    6868    }
    6969
    70     public static function wpTearDownAfterClass() {
    71         foreach ( self::$cat_ids as $cat_id ) {
    72             wp_delete_term( $cat_id, 'category' );
    73         }
    74 
    75         foreach ( self::$tag_ids as $tag_id ) {
    76             wp_delete_term( $tag_id, 'post_tag' );
    77         }
    78 
    79         foreach ( self::$post_ids as $post_id ) {
    80             wp_delete_post( $post_id, true );
    81         }
    82     }
    83 
    8470    function setUp() {
    8571        parent::setUp();
Note: See TracChangeset for help on using the changeset viewer.