- Timestamp:
- 06/10/2020 06:18:25 PM (5 years ago)
- Location:
- branches/5.1
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.1
- Property svn:mergeinfo changed
/trunk merged: 47948-47951
- Property svn:mergeinfo changed
-
branches/5.1/tests/phpunit/tests/oembed/filterResult.php
r42343 r47963 103 103 $this->assertEquals( '<blockquote class="wp-embedded-content"></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"></iframe>', $actual ); 104 104 } 105 106 public function _data_oembed_test_strings() { 107 return array( 108 array( 109 '<blockquote></blockquote><iframe title=""></iframe>', 110 '<blockquote class="wp-embedded-content"></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="position: absolute; clip: rect(1px, 1px, 1px, 1px);" title="Hola"></iframe>', 111 ), 112 array( 113 '<blockquote class="foo" id="bar"><strong><a href="" target=""></a></strong></blockquote><iframe width=123></iframe>', 114 '<blockquote class="wp-embedded-content"><a href=""></a></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="position: absolute; clip: rect(1px, 1px, 1px, 1px);" title="Hola" width="123"></iframe>', 115 ), 116 array( 117 '<blockquote><iframe width="100"></iframe></blockquote><iframe stitle="aaaa"></iframe>', 118 '<blockquote class="wp-embedded-content"><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="position: absolute; clip: rect(1px, 1px, 1px, 1px);" title="Hola" width="100"></iframe></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="position: absolute; clip: rect(1px, 1px, 1px, 1px);" title="Hola"></iframe>', 119 ), 120 array( 121 "<blockquote><iframe title=' width=\"'></iframe></blockquote><iframe title='' height=' title=' width=\"'' heigt='123'\"></iframe>", 122 '<blockquote class="wp-embedded-content"><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="position: absolute; clip: rect(1px, 1px, 1px, 1px);" title=" width=""></iframe></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="position: absolute; clip: rect(1px, 1px, 1px, 1px);" title=" width="" height=\' title=\' width="\'\' heigt=\'123\'"></iframe>', 123 ), 124 ); 125 } 126 127 /** 128 * @dataProvider _data_oembed_test_strings 129 */ 130 public function test_wp_filter_pre_oembed_custom_result( $html, $expected ) { 131 $data = (object) array( 132 'type' => 'rich', 133 'title' => 'Hola', 134 'html' => $html, 135 ); 136 $actual = _wp_oembed_get_object()->data2html( $data, 'https://untrusted.localhost' ); 137 $this->assertEquals( $expected, $actual ); 138 } 105 139 }
Note: See TracChangeset
for help on using the changeset viewer.