| | 403 | |
| | 404 | /** |
| | 405 | * ticket 3833 |
| | 406 | */ |
| | 407 | function test_autop_blockquote_p() { |
| | 408 | $input = "<blockquote>This is a blockquote</blockquote>"; |
| | 409 | $expected = "<blockquote><p>This is a blockquote</p></blockquote>"; |
| | 410 | $this->assertEquals( $expected, trim( wpautop( $input ) ) ); |
| | 411 | } |
| | 412 | |
| | 413 | /** |
| | 414 | * @ticket 3833 |
| | 415 | */ |
| | 416 | function test_autop_content_before() { |
| | 417 | $input = <<<EOF |
| | 418 | text before <div class="whatever"><blockquote> |
| | 419 | text inside the blockquote tag |
| | 420 | </blockquote> |
| | 421 | Some text inside the div embedding the blockquote and after the closing blockquote tag |
| | 422 | </div> |
| | 423 | EOF; |
| | 424 | |
| | 425 | $expected = <<<EOF |
| | 426 | <p>text before</p> |
| | 427 | <div class="whatever"> |
| | 428 | <blockquote> |
| | 429 | <p>text inside the blockquote tag</p> |
| | 430 | </blockquote> |
| | 431 | <p>Some text inside the div embedding the blockquote and after the closing blockquote tag</p> |
| | 432 | </div> |
| | 433 | |
| | 434 | EOF; |
| | 435 | $this->assertEquals( $expected, wpautop( $input ) ); |
| | 436 | } |
| | 437 | |
| | 438 | /** |
| | 439 | * @ticket 25785 |
| | 440 | */ |
| | 441 | function test_div_with_multiple_p() { |
| | 442 | $input = "<div>Insert FIRST PARAGRAPH here. |
| | 443 | |
| | 444 | Insert SECOND PARAGRAPH here.</div>"; |
| | 445 | $expected = <<<EOF |
| | 446 | <div> |
| | 447 | <p>Insert FIRST PARAGRAPH here.</p> |
| | 448 | <p>Insert SECOND PARAGRAPH here.</p> |
| | 449 | </div> |
| | 450 | EOF; |
| | 451 | $this->assertEquals( $expected, trim( wpautop( $input ) ) ); |
| | 452 | } |
| | 453 | |
| | 454 | /** |
| | 455 | * @ticket 27350 |
| | 456 | */ |
| | 457 | function test_wpautop_div_with_pre() { |
| | 458 | $input = "hello<div>test</div>"; |
| | 459 | $expected = <<<EOF |
| | 460 | <p>hello</p> |
| | 461 | <div>test</div> |
| | 462 | |
| | 463 | EOF; |
| | 464 | $this->assertEquals( $expected, wpautop( $input ) ); |
| | 465 | } |