diff --git a/tests/phpunit/tests/formatting/MakeClickable.php b/tests/phpunit/tests/formatting/MakeClickable.php index 5639ce1b1d..63ad5559a2 100644 --- a/tests/phpunit/tests/formatting/MakeClickable.php +++ b/tests/phpunit/tests/formatting/MakeClickable.php @@ -316,16 +316,12 @@ class Tests_Formatting_MakeClickable extends WP_UnitTestCase { } /** - * ticket 16892 + * @ticket 16892 */ function test_no_segfault() { - if ( version_compare( $GLOBALS['wp_version'], '3.1.1', '<' ) ) - $this->markTestSkipped(); - $in = str_repeat( 'http://example.com/2011/03/18/post-title/', 256 ); $out = make_clickable( $in ); - if ( version_compare( $GLOBALS['wp_version'], '3.4-alpha', '>=' ) ) - $this->assertEquals( $in, $out ); + $this->assertEquals( $in, $out ); } /** diff --git a/tests/phpunit/tests/mail.php b/tests/phpunit/tests/mail.php index 425fed5b0d..9b8d6ae602 100644 --- a/tests/phpunit/tests/mail.php +++ b/tests/phpunit/tests/mail.php @@ -127,18 +127,12 @@ Content-Transfer-Encoding: 8bit // WordPress 3.2 and later correctly split the address into the two parts and send them seperately to PHPMailer // Earlier versions of PHPMailer were not touchy about the formatting of these arguments. - if ( version_compare( $GLOBALS['wp_version'], '3.1.9', '>' ) ) { - $this->assertEquals('address@tld.com', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0]); - $this->assertEquals('Name', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][1]); - $this->assertEquals('cc@cc.com', $GLOBALS['phpmailer']->mock_sent[0]['cc'][0][0]); - $this->assertEquals('The Carbon Guy', $GLOBALS['phpmailer']->mock_sent[0]['cc'][0][1]); - $this->assertEquals('bcc@bcc.com', $GLOBALS['phpmailer']->mock_sent[0]['bcc'][0][0]); - $this->assertEquals('The Blind Carbon Guy', $GLOBALS['phpmailer']->mock_sent[0]['bcc'][0][1]); - } else { - $this->assertEquals($to, $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0]); - $this->assertEquals($cc, $GLOBALS['phpmailer']->mock_sent[0]['cc'][0][0]); - $this->assertEquals($bcc, $GLOBALS['phpmailer']->mock_sent[0]['bcc'][0][0]); - } + $this->assertEquals('address@tld.com', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0]); + $this->assertEquals('Name', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][1]); + $this->assertEquals('cc@cc.com', $GLOBALS['phpmailer']->mock_sent[0]['cc'][0][0]); + $this->assertEquals('The Carbon Guy', $GLOBALS['phpmailer']->mock_sent[0]['cc'][0][1]); + $this->assertEquals('bcc@bcc.com', $GLOBALS['phpmailer']->mock_sent[0]['bcc'][0][0]); + $this->assertEquals('The Blind Carbon Guy', $GLOBALS['phpmailer']->mock_sent[0]['bcc'][0][1]); $this->assertEquals($message . "\n", $GLOBALS['phpmailer']->mock_sent[0]['body']); unset( $_SERVER['SERVER_NAME'] ); @@ -159,15 +153,10 @@ Content-Transfer-Encoding: 8bit // WordPress 3.2 and later correctly split the address into the two parts and send them seperately to PHPMailer // Earlier versions of PHPMailer were not touchy about the formatting of these arguments. - if ( version_compare( $GLOBALS['wp_version'], '3.1.9', '>' ) ) { - $this->assertEquals('address@tld.com', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0]); - $this->assertEquals('Name', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][1]); - $this->assertEquals('another_address@different-tld.com', $GLOBALS['phpmailer']->mock_sent[0]['to'][1][0]); - $this->assertEquals('Another Name', $GLOBALS['phpmailer']->mock_sent[0]['to'][1][1]); - } else { - $this->assertEquals('Name ', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0]); - $this->assertEquals('Another Name ', $GLOBALS['phpmailer']->mock_sent[0]['to'][1][0]); - } + $this->assertEquals('address@tld.com', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0]); + $this->assertEquals('Name', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][1]); + $this->assertEquals('another_address@different-tld.com', $GLOBALS['phpmailer']->mock_sent[0]['to'][1][0]); + $this->assertEquals('Another Name', $GLOBALS['phpmailer']->mock_sent[0]['to'][1][1]); $this->assertEquals($message . "\n", $GLOBALS['phpmailer']->mock_sent[0]['body']); unset( $_SERVER['SERVER_NAME'] ); @@ -201,11 +190,8 @@ Content-Transfer-Encoding: 8bit $_SERVER['SERVER_NAME'] = 'example.com'; wp_mail( $to, $subject, $message ); - // Old PHPMailer blindly accepts the address, the new one santizes it - if ( version_compare( $GLOBALS['wp_version'], '3.1.9', '>' ) ) - $this->assertEquals('address@tld.com', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0]); - else - $this->assertEquals('', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0]); + $this->assertEquals('address@tld.com', $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0]); + $this->assertEquals($message . "\n", $GLOBALS['phpmailer']->mock_sent[0]['body']); unset( $_SERVER['SERVER_NAME'] ); } diff --git a/tests/phpunit/tests/theme.php b/tests/phpunit/tests/theme.php index 3f11ad1e26..52b4c0c030 100644 --- a/tests/phpunit/tests/theme.php +++ b/tests/phpunit/tests/theme.php @@ -174,14 +174,14 @@ class Tests_Theme extends WP_UnitTestCase { function test_switch_theme() { $themes = get_themes(); - $switch_theme_one_argument = version_compare( $GLOBALS['wp_version'], '3.5-alpha-21103', '>=' ); + // Switch to each theme in sequence. + // Do it twice to make sure we switch to the first theme, even if it's our starting theme. + // Do it a third time to ensure switch_theme() works with one argument. - // switch to each theme in sequence - // do it twice to make sure we switch to the first theme, even if it's our starting theme for ( $i = 0; $i < 3; $i++ ) { foreach ($themes as $name=>$theme) { // switch to this theme - if ( $i === 2 || $switch_theme_one_argument ) + if ( $i === 2 ) switch_theme( $theme['Template'], $theme['Stylesheet'] ); else switch_theme( $theme['Stylesheet'] );