WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/08/2014 07:28:12 PM (7 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/customRules.php

    r25002 r30277  
    11<?php
    2 
    3 require_once dirname( dirname( __FILE__ ) ) . '/canonical.php';
    42
    53/**
     
    86 * @group query
    97 */
    10 class Tests_Canonical_CustomRules extends Tests_Canonical {
     8class Tests_Canonical_CustomRules extends WP_Canonical_UnitTestCase {
     9
    1110    function setUp() {
    1211        parent::setUp();
     
    1514        $wp_rewrite->add_rule('ccr/(.+?)/sort/(asc|desc)', 'index.php?category_name=$matches[1]&order=$matches[2]', 'top'); // ccr = Custom_Cat_Rule
    1615        $wp_rewrite->flush_rules();
     16    }
     17
     18    /**
     19     * @dataProvider data
     20     */
     21    function test( $test_url, $expected, $ticket = 0, $expected_doing_it_wrong = array() ) {
     22        $this->assertCanonical( $test_url, $expected, $ticket, $expected_doing_it_wrong );
    1723    }
    1824
Note: See TracChangeset for help on using the changeset viewer.