Changeset 42343 for trunk/tests/phpunit/tests/formatting/Autop.php
- Timestamp:
- 11/30/2017 11:09:33 PM (8 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/formatting/Autop.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/formatting/Autop.php
r39914 r42343 7 7 //From ticket https://core.trac.wordpress.org/ticket/11008 8 8 function test_first_post() { 9 $expected = '<p>Welcome to WordPress! This post contains important information. After you read it, you can make it private to hide it from visitors but still have the information handy for future reference.</p>9 $expected = '<p>Welcome to WordPress! This post contains important information. After you read it, you can make it private to hide it from visitors but still have the information handy for future reference.</p> 10 10 <p>First things first:</p> 11 11 <ul> … … 58 58 59 59 // On windows environments, the EOL-style is \r\n 60 $expected = str_replace( "\r\n", "\n", $expected );61 62 $this->assertEquals( $expected, wpautop($test_data));60 $expected = str_replace( "\r\n", "\n", $expected ); 61 62 $this->assertEquals( $expected, wpautop( $test_data ) ); 63 63 } 64 64 … … 85 85 86 86 // Make sure HTML breaks are maintained if manually inserted 87 $str = "Look at this code\n\n<pre>Line1<br />Line2<br>Line3<br/>Line4\nActual Line 2\nActual Line 3</pre>\n\nCool, huh?";87 $str = "Look at this code\n\n<pre>Line1<br />Line2<br>Line3<br/>Line4\nActual Line 2\nActual Line 3</pre>\n\nCool, huh?"; 88 88 $expected = "<p>Look at this code</p>\n<pre>Line1<br />Line2<br>Line3<br/>Line4\nActual Line 2\nActual Line 3</pre>\n<p>Cool, huh?</p>"; 89 89 $this->assertEquals( $expected, trim( wpautop( $str ) ) ); … … 337 337 338 338 $expected = join( "\n", $content ); 339 $input = join( "\n\n", $content ); // WS difference339 $input = join( "\n\n", $content ); // WS difference 340 340 341 341 $this->assertEquals( $expected, trim( wpautop( $input ) ) ); 342 342 343 $input = join( "", $content ); // WS difference343 $input = join( '', $content ); // WS difference 344 344 345 345 $this->assertEquals( $expected, trim( wpautop( $input ) ) ); … … 353 353 354 354 $expected = join( "\n", $content ); 355 $input = join( "", $content );355 $input = join( '', $content ); 356 356 357 357 $this->assertEquals( $expected, trim( wpautop( $input ) ) ); … … 365 365 366 366 $expected = join( "\n", $content ); 367 $input = join( "", $content );367 $input = join( '', $content ); 368 368 369 369 $this->assertEquals( $expected, trim( wpautop( $input ) ) ); … … 376 376 */ 377 377 function test_that_wpautop_does_not_wrap_blockquotes_but_does_autop_their_contents() { 378 $content = "<blockquote>foo</blockquote>";379 $expected = "<blockquote><p>foo</p></blockquote>";378 $content = '<blockquote>foo</blockquote>'; 379 $expected = '<blockquote><p>foo</p></blockquote>'; 380 380 381 381 $this->assertEquals( $expected, trim( wpautop( $content ) ) ); … … 420 420 421 421 foreach ( $inlines as $inline ) { 422 $content[] = "<$inline>foo</$inline>";422 $content[] = "<$inline>foo</$inline>"; 423 423 $expected[] = "<p><$inline>foo</$inline></p>"; 424 424 } 425 425 426 $content = join( "\n\n", $content );426 $content = join( "\n\n", $content ); 427 427 $expected = join( "\n", $expected ); 428 428 … … 458 458 "<p>Hello <!-- <object>\n<param/>\n<param/>\n<embed>\n</embed>\n</object>\n --></p>\n", 459 459 ), 460 /* Block elements inside comments will fail this test in all versions, it's not a regression.461 array(462 "Hello <!-- <hr> a\nhref='world' -->",463 "<p>Hello <!-- <hr> a\nhref='world' --></p>\n",464 ),465 array(466 "Hello <![CDATA[ <hr> a\nhttps://youtu.be/jgz0uSaOZbE\n ]]>",467 "<p>Hello <![CDATA[ <hr> a\nhttps://youtu.be/jgz0uSaOZbE\n ]]></p>\n",468 ),469 */470 array(471 "Hello <![CDATA[ a\nhttps://youtu.be/jgz0uSaOZbE\n ]]>",472 "<p>Hello <![CDATA[ a\nhttps://youtu.be/jgz0uSaOZbE\n ]]></p>\n",473 ),460 /* Block elements inside comments will fail this test in all versions, it's not a regression. 461 array( 462 "Hello <!-- <hr> a\nhref='world' -->", 463 "<p>Hello <!-- <hr> a\nhref='world' --></p>\n", 464 ), 465 array( 466 "Hello <![CDATA[ <hr> a\nhttps://youtu.be/jgz0uSaOZbE\n ]]>", 467 "<p>Hello <![CDATA[ <hr> a\nhttps://youtu.be/jgz0uSaOZbE\n ]]></p>\n", 468 ), 469 */ 470 array( 471 "Hello <![CDATA[ a\nhttps://youtu.be/jgz0uSaOZbE\n ]]>", 472 "<p>Hello <![CDATA[ a\nhttps://youtu.be/jgz0uSaOZbE\n ]]></p>\n", 473 ), 474 474 array( 475 475 "Hello <![CDATA[ <!-- a\nhttps://youtu.be/jgz0uSaOZbE\n a\n9 ]]> -->", … … 530 530 */ 531 531 function test_that_text_before_blocks_is_peed() { 532 $content = 'a<div>b</div>';532 $content = 'a<div>b</div>'; 533 533 $expected = "<p>a</p>\n<div>b</div>"; 534 534
Note: See TracChangeset
for help on using the changeset viewer.