Make WordPress Core

Changeset 25264


Ignore:
Timestamp:
09/05/2013 09:56:10 PM (10 years ago)
Author:
nacin
Message:

Remove old WP version checks from PHPUnit test cases now that tests are branched with each version.

Location:
trunk/tests/phpunit/tests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/formatting/MakeClickable.php

    r25002 r25264  
    317317
    318318    /**
    319      * ticket 16892
     319     * @ticket 16892
    320320     */
    321321    function test_no_segfault() {
    322         if ( version_compare( $GLOBALS['wp_version'], '3.1.1', '<' ) )
    323             $this->markTestSkipped();
    324 
    325322        $in = str_repeat( 'http://example.com/2011/03/18/post-title/', 256 );
    326323        $out = make_clickable( $in );
    327         if ( version_compare( $GLOBALS['wp_version'], '3.4-alpha', '>=' ) )
    328             $this->assertEquals( $in, $out );
     324        $this->assertEquals( $in, $out );
    329325    }
    330326
  • trunk/tests/phpunit/tests/mail.php

    r25002 r25264  
    128128        // WordPress 3.2 and later correctly split the address into the two parts and send them seperately to PHPMailer
    129129        // Earlier versions of PHPMailer were not touchy about the formatting of these arguments.
    130         if ( version_compare( $GLOBALS['wp_version'], '3.1.9', '>' ) ) {
    131             $this->assertEquals('address@tld.com', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0]);
    132             $this->assertEquals('Name', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][1]);
    133             $this->assertEquals('cc@cc.com', $GLOBALS['phpmailer']->mock_sent[0]['cc'][0][0]);
    134             $this->assertEquals('The Carbon Guy', $GLOBALS['phpmailer']->mock_sent[0]['cc'][0][1]);
    135             $this->assertEquals('bcc@bcc.com', $GLOBALS['phpmailer']->mock_sent[0]['bcc'][0][0]);
    136             $this->assertEquals('The Blind Carbon Guy', $GLOBALS['phpmailer']->mock_sent[0]['bcc'][0][1]);
    137         } else {
    138             $this->assertEquals($to, $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0]);
    139             $this->assertEquals($cc, $GLOBALS['phpmailer']->mock_sent[0]['cc'][0][0]);
    140             $this->assertEquals($bcc, $GLOBALS['phpmailer']->mock_sent[0]['bcc'][0][0]);
    141         }
     130        $this->assertEquals('address@tld.com', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0]);
     131        $this->assertEquals('Name', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][1]);
     132        $this->assertEquals('cc@cc.com', $GLOBALS['phpmailer']->mock_sent[0]['cc'][0][0]);
     133        $this->assertEquals('The Carbon Guy', $GLOBALS['phpmailer']->mock_sent[0]['cc'][0][1]);
     134        $this->assertEquals('bcc@bcc.com', $GLOBALS['phpmailer']->mock_sent[0]['bcc'][0][0]);
     135        $this->assertEquals('The Blind Carbon Guy', $GLOBALS['phpmailer']->mock_sent[0]['bcc'][0][1]);
    142136
    143137        $this->assertEquals($message . "\n", $GLOBALS['phpmailer']->mock_sent[0]['body']);
     
    160154        // WordPress 3.2 and later correctly split the address into the two parts and send them seperately to PHPMailer
    161155        // Earlier versions of PHPMailer were not touchy about the formatting of these arguments.
    162         if ( version_compare( $GLOBALS['wp_version'], '3.1.9', '>' ) ) {
    163             $this->assertEquals('address@tld.com', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0]);
    164             $this->assertEquals('Name', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][1]);
    165             $this->assertEquals('another_address@different-tld.com', $GLOBALS['phpmailer']->mock_sent[0]['to'][1][0]);
    166             $this->assertEquals('Another Name', $GLOBALS['phpmailer']->mock_sent[0]['to'][1][1]);
    167         } else {
    168             $this->assertEquals('Name <address@tld.com>', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0]);
    169             $this->assertEquals('Another Name <another_address@different-tld.com>', $GLOBALS['phpmailer']->mock_sent[0]['to'][1][0]);
    170         }
     156        $this->assertEquals('address@tld.com', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0]);
     157        $this->assertEquals('Name', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][1]);
     158        $this->assertEquals('another_address@different-tld.com', $GLOBALS['phpmailer']->mock_sent[0]['to'][1][0]);
     159        $this->assertEquals('Another Name', $GLOBALS['phpmailer']->mock_sent[0]['to'][1][1]);
    171160
    172161        $this->assertEquals($message . "\n", $GLOBALS['phpmailer']->mock_sent[0]['body']);
     
    202191        wp_mail( $to, $subject, $message );
    203192
    204         // Old PHPMailer blindly accepts the address, the new one santizes it
    205         if ( version_compare( $GLOBALS['wp_version'], '3.1.9', '>' ) )
    206             $this->assertEquals('address@tld.com', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0]);
    207         else
    208             $this->assertEquals('<address@tld.com>', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0]);
     193        $this->assertEquals('address@tld.com', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0]);
     194
    209195        $this->assertEquals($message . "\n", $GLOBALS['phpmailer']->mock_sent[0]['body']);
    210196        unset( $_SERVER['SERVER_NAME'] );
  • trunk/tests/phpunit/tests/theme.php

    r25002 r25264  
    175175        $themes = get_themes();
    176176
    177         $switch_theme_one_argument = version_compare( $GLOBALS['wp_version'], '3.5-alpha-21103', '>=' );
    178 
    179         // switch to each theme in sequence
    180         // do it twice to make sure we switch to the first theme, even if it's our starting theme
     177        // Switch to each theme in sequence.
     178        // Do it twice to make sure we switch to the first theme, even if it's our starting theme.
     179        // Do it a third time to ensure switch_theme() works with one argument.
     180
    181181        for ( $i = 0; $i < 3; $i++ ) {
    182182            foreach ($themes as $name=>$theme) {
    183183                // switch to this theme
    184                 if ( $i === 2 || $switch_theme_one_argument )
     184                if ( $i === 2 )
    185185                    switch_theme( $theme['Template'], $theme['Stylesheet'] );
    186186                else
Note: See TracChangeset for help on using the changeset viewer.