WordPress.org

Make WordPress Core

Changeset 893 in tests


Ignore:
Timestamp:
07/09/12 14:38:23 (2 years ago)
Author:
nacin
Message:

Use @ticket annotation for tracking related tickets, largely replacing knownWPBug() and friends.

The existing methods should remain, for use in dynamic or conditional contexts, like the canonical tests or an is_multisite() check.

props duck_. see #102.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/testcase.php

    r883 r893  
    119119    } 
    120120 
     121    protected function checkRequirements() { 
     122        parent::checkRequirements(); 
     123        if ( WP_TESTS_FORCE_KNOWN_BUGS ) 
     124            return; 
     125        $tickets = PHPUnit_Util_Test::getTickets( get_class( $this ), $this->getName() ); 
     126        foreach ( $tickets as $ticket ) { 
     127            if ( is_numeric( $ticket ) ) { 
     128                $this->knownWPBug( $ticket ); 
     129            } elseif ( 'UT' == substr( $ticket, 0, 2 ) ) { 
     130                $this->knownUTBug( substr( $ticket, 2 ) ); 
     131            } 
     132        } 
     133    } 
     134 
    121135    /** 
    122      * Skips the current test if there is open WordPress ticket with id $ticket_id 
     136     * Skips the current test if there is an open WordPress ticket with id $ticket_id 
    123137     */ 
    124138    function knownWPBug( $ticket_id ) { 
     
    129143 
    130144    /** 
    131      * Skips the current test if there is open unit tests ticket with id $ticket_id 
     145     * Skips the current test if there is an open unit tests ticket with id $ticket_id 
    132146     */ 
    133147    function knownUTBug( $ticket_id ) { 
     
    138152 
    139153    /** 
    140      * Skips the current test if there is open plugin ticket with id $ticket_id 
     154     * Skips the current test if there is an open plugin ticket with id $ticket_id 
    141155     */ 
    142156    function knownPluginBug( $ticket_id ) { 
  • trunk/tests/test_post_output.php

    r875 r893  
    128128 * @group media 
    129129 * @group gallery 
     130 * @ticket UT30 
    130131 */ 
    131132class WPTestGalleryPost extends WP_UnitTestCase { // _WPDataset1 
    132133    function setUp() { 
    133         $this->knownUTBug(30); 
    134134        parent::setUp(); 
    135135        global $wp_rewrite; 
  • trunk/tests/test_shortcode.php

    r881 r893  
    164164    } 
    165165 
     166    /** 
     167     * @ticket 6518 
     168     */ 
    166169    function test_tag_escaped() { 
    167         $this->knownWPBug(6518); 
    168  
    169170        $out = do_shortcode('[[footag]] [[bartag foo="bar"]]'); 
    170171        $this->assertEquals('[footag] [bartag foo="bar"]', $out); 
     
    236237    } 
    237238 
    238     //TODO Review this test as it may be incorrect 
     239    /** 
     240     * @ticket 6562 
     241     * 
     242     * @TODO Review this test as it may be incorrect 
     243     */ 
    239244    function test_utf8_whitespace_1() { 
    240         // see http://trac.wordpress.org/ticket/6562 
    241         $this->knownWPBug(6562); 
    242245        do_shortcode("[test-shortcode-tag foo=\"bar\" \x00\xA0baz=\"123\"]"); 
    243246        $this->assertEquals( array('foo' => 'bar', 'baz' => '123'), $this->atts ); 
     
    245248    } 
    246249 
    247     //TODO Review this test as it may be incorrect 
     250    /** 
     251     * @ticket 6562 
     252     * 
     253     * @TODO Review this test as it may be incorrect 
     254     */ 
    248255    function test_utf8_whitespace_2() { 
    249         // see http://trac.wordpress.org/ticket/6562 
    250         $this->knownWPBug(6562); 
    251256        do_shortcode("[test-shortcode-tag foo=\"bar\" \x20\x0babc=\"def\"]"); 
    252257        $this->assertEquals( array('foo' => 'bar', 'abc' => 'def'), $this->atts ); 
     
    264269    } 
    265270 
     271    /** 
     272     * @ticket 14050 
     273     */ 
    266274    function test_multiple_shortcode_unautop() { 
    267         // see http://trac.wordpress.org/ticket/14050 
    268         $this->knownWPBug(14050); 
    269275        // a blank line is added at the end, so test with it already there 
    270276        $test_string = <<<EOF 
     
    278284    } 
    279285 
     286    /** 
     287     * @ticket 10326 
     288     */ 
    280289    function test_strip_shortcodes() { 
    281         $this->knownWPBug( 10326 ); 
    282290        $this->assertEquals('before', strip_shortcodes('before[gallery]')); 
    283291        $this->assertEquals('after', strip_shortcodes('[gallery]after')); 
Note: See TracChangeset for help on using the changeset viewer.