Changeset 48937 for trunk/tests/phpunit/tests/formatting/Autop.php
- Timestamp:
- 09/02/2020 12:35:36 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/formatting/Autop.php
r47600 r48937 63 63 $expected = str_replace( "\r\n", "\n", $expected ); 64 64 65 $this->assert Equals( $expected, wpautop( $test_data ) );65 $this->assertSame( $expected, wpautop( $test_data ) ); 66 66 } 67 67 … … 78 78 // Not wrapped in <p> tags. 79 79 $str = "<pre>$code</pre>"; 80 $this->assert Equals( $str, trim( wpautop( $str ) ) );80 $this->assertSame( $str, trim( wpautop( $str ) ) ); 81 81 82 82 // Text before/after is wrapped in <p> tags. … … 85 85 // Expected text after wpautop(). 86 86 $expected = '<p>Look at this code</p>' . "\n<pre>" . $code . "</pre>\n" . '<p>Isn\'t that cool?</p>'; 87 $this->assert Equals( $expected, trim( wpautop( $str ) ) );87 $this->assertSame( $expected, trim( wpautop( $str ) ) ); 88 88 89 89 // Make sure HTML breaks are maintained if manually inserted. 90 90 $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?"; 91 91 $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>"; 92 $this->assert Equals( $expected, trim( wpautop( $str ) ) );92 $this->assertSame( $expected, trim( wpautop( $str ) ) ); 93 93 } 94 94 … … 100 100 public function test_skip_input_elements() { 101 101 $str = 'Username: <input type="text" id="username" name="username" /><br />Password: <input type="password" id="password1" name="password1" />'; 102 $this->assert Equals( "<p>$str</p>", trim( wpautop( $str ) ) );102 $this->assertSame( "<p>$str</p>", trim( wpautop( $str ) ) ); 103 103 } 104 104 … … 184 184 '<p>Paragraph two.</p>'; 185 185 186 $this->assert Equals( $expected, trim( wpautop( $content ) ) );187 $this->assert Equals( $expected, trim( wpautop( $content2 ) ) );188 $this->assert Equals( $shortcode_expected, trim( wpautop( $shortcode_content ) ) );186 $this->assertSame( $expected, trim( wpautop( $content ) ) ); 187 $this->assertSame( $expected, trim( wpautop( $content2 ) ) ); 188 $this->assertSame( $shortcode_expected, trim( wpautop( $shortcode_content ) ) ); 189 189 } 190 190 … … 264 264 '<p>Paragraph two.</p>'; 265 265 266 $this->assert Equals( $expected1, trim( wpautop( $content1 ) ) );267 $this->assert Equals( $expected2, trim( wpautop( $content2 ) ) );266 $this->assertSame( $expected1, trim( wpautop( $content1 ) ) ); 267 $this->assertSame( $expected2, trim( wpautop( $content2 ) ) ); 268 268 } 269 269 … … 275 275 public function test_skip_select_option_elements() { 276 276 $str = 'Country: <select id="state" name="state"><option value="1">Alabama</option><option value="2">Alaska</option><option value="3">Arizona</option><option value="4">Arkansas</option><option value="5">California</option></select>'; 277 $this->assert Equals( "<p>$str</p>", trim( wpautop( $str ) ) );277 $this->assertSame( "<p>$str</p>", trim( wpautop( $str ) ) ); 278 278 } 279 279 … … 341 341 $input = join( "\n\n", $content ); // Whitespace difference. 342 342 343 $this->assert Equals( $expected, trim( wpautop( $input ) ) );343 $this->assertSame( $expected, trim( wpautop( $input ) ) ); 344 344 345 345 $input = join( '', $content ); // Whitespace difference. 346 346 347 $this->assert Equals( $expected, trim( wpautop( $input ) ) );347 $this->assertSame( $expected, trim( wpautop( $input ) ) ); 348 348 349 349 // Check whitespace addition. … … 357 357 $input = join( '', $content ); 358 358 359 $this->assert Equals( $expected, trim( wpautop( $input ) ) );359 $this->assertSame( $expected, trim( wpautop( $input ) ) ); 360 360 361 361 // Check whitespace addition with attributes. … … 369 369 $input = join( '', $content ); 370 370 371 $this->assert Equals( $expected, trim( wpautop( $input ) ) );371 $this->assertSame( $expected, trim( wpautop( $input ) ) ); 372 372 } 373 373 … … 381 381 $expected = '<blockquote><p>foo</p></blockquote>'; 382 382 383 $this->assert Equals( $expected, trim( wpautop( $content ) ) );383 $this->assertSame( $expected, trim( wpautop( $content ) ) ); 384 384 } 385 385 … … 430 430 $expected = join( "\n", $expected ); 431 431 432 $this->assert Equals( $expected, trim( wpautop( $content ) ) );432 $this->assertSame( $expected, trim( wpautop( $content ) ) ); 433 433 } 434 434 … … 440 440 */ 441 441 function test_element_sanity( $input, $output ) { 442 return $this->assert Equals( $output, wpautop( $input ) );442 return $this->assertSame( $output, wpautop( $input ) ); 443 443 } 444 444 … … 506 506 line 5</p>'; 507 507 508 $this->assert EqualsIgnoreEOL( $expected, trim( wpautop( $content ) ) );508 $this->assertSameIgnoreEOL( $expected, trim( wpautop( $content ) ) ); 509 509 } 510 510 … … 525 525 <p>line 2</p>'; 526 526 527 $this->assert EqualsIgnoreEOL( $expected, trim( wpautop( $content ) ) );527 $this->assertSameIgnoreEOL( $expected, trim( wpautop( $content ) ) ); 528 528 } 529 529 … … 536 536 $expected = "<p>a</p>\n<div>b</div>"; 537 537 538 $this->assert Equals( $expected, trim( wpautop( $content ) ) );538 $this->assertSame( $expected, trim( wpautop( $content ) ) ); 539 539 } 540 540 … … 559 559 <img src="example.jpg" /><figcaption>Caption</figcaption></figure>'; 560 560 561 $this->assert Equals( $expected1, trim( wpautop( $content1 ) ) );562 $this->assert EqualsIgnoreEOL( $expected2, trim( wpautop( $content2 ) ) );561 $this->assertSame( $expected1, trim( wpautop( $content1 ) ) ); 562 $this->assertSameIgnoreEOL( $expected2, trim( wpautop( $content2 ) ) ); 563 563 } 564 564 … … 570 570 $expected = "<p>paragraph1</p>\n<hr>\n<p>paragraph2</p>"; 571 571 572 $this->assert Equals( $expected, trim( wpautop( $content ) ) );572 $this->assertSame( $expected, trim( wpautop( $content ) ) ); 573 573 } 574 574 … … 588 588 $expected = '<p>' . $content . '</p>'; 589 589 590 $this->assert EqualsIgnoreEOL( $expected, trim( wpautop( $content ) ) );590 $this->assertSameIgnoreEOL( $expected, trim( wpautop( $content ) ) ); 591 591 } 592 592 … … 604 604 $expected = '<p>' . $content . '</p>'; 605 605 606 $this->assert EqualsIgnoreEOL( $expected, trim( wpautop( $content ) ) );606 $this->assertSameIgnoreEOL( $expected, trim( wpautop( $content ) ) ); 607 607 } 608 608 }
Note: See TracChangeset
for help on using the changeset viewer.