Make WordPress Core


Ignore:
Timestamp:
11/08/2014 07:28:12 PM (10 years ago)
Author:
boonebgorges
Message:

Share fixtures across 'canonical' automated tests.

Sharing these fixtures results in a speed improvement of almost one minute per
run of the test suite.

My hope is that future WordPress developers will spend this extra minute with
their loved ones, for life on this earth is short, my friends, and the moments
you spend watching WP generate test data can never again be reclaimed from the
grizzled clutches of Time, and none of us are really getting younger, I mean,
geez, have you looked in the mirror lately, Gandalf?

See #30017.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/canonical/noRewrite.php

    r25002 r30277  
    88 * @group query
    99 */
    10 class Tests_Canonical_NoRewrite extends Tests_Canonical {
    11 
    12     var $structure = '';
     10class Tests_Canonical_NoRewrite extends WP_Canonical_UnitTestCase {
    1311
    1412    // These test cases are run against the test handler in WP_Canonical
     13    public static function setUpBeforeClass() {
     14        self::generate_shared_fixtures();
     15    }
     16
     17    public static function tearDownAfterClass() {
     18        self::delete_shared_fixtures();
     19    }
     20
     21    public function setUp() {
     22        global $wp_rewrite;
     23
     24        parent::setUp();
     25
     26        $wp_rewrite->init();
     27        $wp_rewrite->set_permalink_structure( '' );
     28        $wp_rewrite->flush_rules();
     29        $wp_rewrite->init();
     30    }
     31
     32    /**
     33     * @dataProvider data
     34     */
     35    function test( $test_url, $expected, $ticket = 0, $expected_doing_it_wrong = array() ) {
     36        $this->assertCanonical( $test_url, $expected, $ticket, $expected_doing_it_wrong );
     37    }
    1538
    1639    function data() {
Note: See TracChangeset for help on using the changeset viewer.