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/pageOnFront.php

    r28966 r30277  
    11<?php
    2 
    3 require_once dirname( dirname( __FILE__ ) ) . '/canonical.php';
    42
    53/**
     
    86 * @group query
    97 */
    10 class Tests_Canonical_PageOnFront extends Tests_Canonical {
     8class Tests_Canonical_PageOnFront extends WP_Canonical_UnitTestCase {
     9    public static function setUpBeforeClass() {
     10        self::generate_shared_fixtures();
     11    }
     12
     13    public static function tearDownAfterClass() {
     14        self::delete_shared_fixtures();
     15    }
     16
    1117    function setUp() {
    1218        parent::setUp();
     
    2329        parent::tearDown();
    2430        $wp_rewrite->init();
     31    }
     32
     33    /**
     34     * @dataProvider data
     35     */
     36    function test( $test_url, $expected, $ticket = 0, $expected_doing_it_wrong = array() ) {
     37        $this->assertCanonical( $test_url, $expected, $ticket, $expected_doing_it_wrong );
    2538    }
    2639
Note: See TracChangeset for help on using the changeset viewer.