Changeset 44226 for trunk/tests/phpunit/tests/blocks/render.php
- Timestamp:
- 12/16/2018 02:22:43 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/5.0 merged: 43879,43881
- Property svn:mergeinfo changed
-
trunk/tests/phpunit/tests/blocks/render.php
r44118 r44226 76 76 $block_filtered_content = preg_replace( "/\n{2,}/", "\n", $block_filtered_content ); 77 77 78 $this->assertEquals( $classic_filtered_content, $block_filtered_content);78 $this->assertEquals( trim( $classic_filtered_content ), trim( $block_filtered_content ) ); 79 79 } 80 80 81 81 function handle_shortcode( $atts, $content ) { 82 82 return $content; 83 } 84 85 /** 86 * @ticket 45290 87 */ 88 public function test_blocks_arent_autopeed() { 89 $expected_content = 'test'; 90 $test_content = "<!-- wp:fake/block -->\n$expected_content\n<!-- /wp:fake/block -->"; 91 92 $current_priority = has_action( 'the_content', 'wpautop' ); 93 94 $filtered_content = trim( apply_filters( 'the_content', $test_content ) ); 95 96 $this->assertEquals( $expected_content, $filtered_content ); 97 98 // Check that wpautop() is still defined in the same place. 99 $this->assertSame( $current_priority, has_action( 'the_content', 'wpautop' ) ); 100 // ... and that the restore function has removed itself. 101 $this->assertFalse( has_action( 'the_content', '_restore_wpautop_hook' ) ); 102 103 $test_content = 'test'; 104 $expected_content = "<p>$test_content</p>"; 105 106 $current_priority = has_action( 'the_content', 'wpautop' ); 107 108 $filtered_content = trim( apply_filters( 'the_content', $test_content ) ); 109 110 $this->assertEquals( $expected_content, $filtered_content ); 111 112 $this->assertSame( $current_priority, has_action( 'the_content', 'wpautop' ) ); 113 $this->assertFalse( has_action( 'the_content', '_restore_wpautop_hook' ) ); 83 114 } 84 115
Note: See TracChangeset
for help on using the changeset viewer.