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/ajax/TagSearch.php

    r35311 r38398  
    2929        foreach ( self::$terms as $t ) {
    3030            self::$term_ids[] = wp_insert_term( $t, 'post_tag' );
    31         }
    32     }
    33 
    34     public static function wpTearDownAfterClass() {
    35         foreach ( self::$term_ids as $t ) {
    36             wp_delete_term( $t, 'post_tag' );
    3731        }
    3832    }
Note: See TracChangeset for help on using the changeset viewer.