Changeset 25264
- Timestamp:
- 09/05/2013 09:56:10 PM (12 years ago)
- Location:
- trunk/tests/phpunit/tests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/formatting/MakeClickable.php
r25002 r25264 317 317 318 318 /** 319 * ticket 16892319 * @ticket 16892 320 320 */ 321 321 function test_no_segfault() { 322 if ( version_compare( $GLOBALS['wp_version'], '3.1.1', '<' ) )323 $this->markTestSkipped();324 325 322 $in = str_repeat( 'http://example.com/2011/03/18/post-title/', 256 ); 326 323 $out = make_clickable( $in ); 327 if ( version_compare( $GLOBALS['wp_version'], '3.4-alpha', '>=' ) ) 328 $this->assertEquals( $in, $out ); 324 $this->assertEquals( $in, $out ); 329 325 } 330 326 -
trunk/tests/phpunit/tests/mail.php
r25002 r25264 128 128 // WordPress 3.2 and later correctly split the address into the two parts and send them seperately to PHPMailer 129 129 // 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]); 142 136 143 137 $this->assertEquals($message . "\n", $GLOBALS['phpmailer']->mock_sent[0]['body']); … … 160 154 // WordPress 3.2 and later correctly split the address into the two parts and send them seperately to PHPMailer 161 155 // 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]); 171 160 172 161 $this->assertEquals($message . "\n", $GLOBALS['phpmailer']->mock_sent[0]['body']); … … 202 191 wp_mail( $to, $subject, $message ); 203 192 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 209 195 $this->assertEquals($message . "\n", $GLOBALS['phpmailer']->mock_sent[0]['body']); 210 196 unset( $_SERVER['SERVER_NAME'] ); -
trunk/tests/phpunit/tests/theme.php
r25002 r25264 175 175 $themes = get_themes(); 176 176 177 $switch_theme_one_argument = version_compare( $GLOBALS['wp_version'], '3.5-alpha-21103', '>=' );178 179 // switch to each theme in sequence180 // 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 181 181 for ( $i = 0; $i < 3; $i++ ) { 182 182 foreach ($themes as $name=>$theme) { 183 183 // switch to this theme 184 if ( $i === 2 || $switch_theme_one_argument)184 if ( $i === 2 ) 185 185 switch_theme( $theme['Template'], $theme['Stylesheet'] ); 186 186 else
Note: See TracChangeset
for help on using the changeset viewer.