Changeset 52010 for trunk/tests/phpunit/tests/formatting/makeClickable.php
- Timestamp:
- 11/04/2021 03:22:47 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/formatting/makeClickable.php
r51623 r52010 5 5 */ 6 6 class Tests_Formatting_MakeClickable extends WP_UnitTestCase { 7 function test_mailto_xss() {7 public function test_mailto_xss() { 8 8 $in = 'testzzz@"STYLE="behavior:url(\'#default#time2\')"onBegin="alert(\'refresh-XSS\')"'; 9 9 $this->assertSame( $in, make_clickable( $in ) ); 10 10 } 11 11 12 function test_valid_mailto() {12 public function test_valid_mailto() { 13 13 $valid_emails = array( 14 14 'foo@example.com', … … 23 23 } 24 24 25 function test_invalid_mailto() {25 public function test_invalid_mailto() { 26 26 $invalid_emails = array( 27 27 'foo', … … 41 41 * and (semi-)colons in URLs with protocol (i.e. http://wordpress.org). 42 42 */ 43 function test_strip_trailing_with_protocol() {43 public function test_strip_trailing_with_protocol() { 44 44 $urls_before = array( 45 45 'http://wordpress.org/hello.html', … … 68 68 * and (semi-)colons in URLs with protocol (i.e. http://wordpress.org). 69 69 */ 70 function test_strip_trailing_with_protocol_nothing_afterwards() {70 public function test_strip_trailing_with_protocol_nothing_afterwards() { 71 71 $urls_before = array( 72 72 'http://wordpress.org/hello.html', … … 97 97 * and (semi-)colons in URLs without protocol (i.e. www.wordpress.org). 98 98 */ 99 function test_strip_trailing_without_protocol() {99 public function test_strip_trailing_without_protocol() { 100 100 $urls_before = array( 101 101 'www.wordpress.org', … … 124 124 * and (semi-)colons in URLs without protocol (i.e. www.wordpress.org). 125 125 */ 126 function test_strip_trailing_without_protocol_nothing_afterwards() {126 public function test_strip_trailing_without_protocol_nothing_afterwards() { 127 127 $urls_before = array( 128 128 'www.wordpress.org', … … 150 150 * @ticket 4570 151 151 */ 152 function test_iri() {152 public function test_iri() { 153 153 $urls_before = array( 154 154 'http://www.詹姆斯.com/', … … 169 169 * @ticket 10990 170 170 */ 171 function test_brackets_in_urls() {171 public function test_brackets_in_urls() { 172 172 $urls_before = array( 173 173 'http://en.wikipedia.org/wiki/PC_Tools_(Central_Point_Software)', … … 208 208 * @ticket 11211 209 209 */ 210 function test_real_world_examples() {210 public function test_real_world_examples() { 211 211 $urls_before = array( 212 212 'Example: WordPress, test (some text), I love example.com (http://example.org), it is brilliant', … … 229 229 * @ticket 14993 230 230 */ 231 function test_twitter_hash_bang() {231 public function test_twitter_hash_bang() { 232 232 $urls_before = array( 233 233 'http://twitter.com/#!/wordpress/status/25907440233', … … 245 245 } 246 246 247 function test_wrapped_in_angles() {247 public function test_wrapped_in_angles() { 248 248 $before = array( 249 249 'URL wrapped in angle brackets <http://example.com/>', … … 261 261 } 262 262 263 function test_preceded_by_punctuation() {263 public function test_preceded_by_punctuation() { 264 264 $before = array( 265 265 'Comma then URL,http://example.com/', … … 283 283 } 284 284 285 function test_dont_break_attributes() {285 public function test_dont_break_attributes() { 286 286 $urls_before = array( 287 287 "<img src='http://trunk.domain/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley'>", … … 310 310 * @ticket 23756 311 311 */ 312 function test_no_links_inside_pre_or_code() {312 public function test_no_links_inside_pre_or_code() { 313 313 $before = array( 314 314 '<pre>http://wordpress.org</pre>', … … 351 351 * @ticket 16892 352 352 */ 353 function test_click_inside_html() {353 public function test_click_inside_html() { 354 354 $urls_before = array( 355 355 '<span>http://example.com</span>', … … 365 365 } 366 366 367 function test_no_links_within_links() {367 public function test_no_links_within_links() { 368 368 $in = array( 369 369 'Some text with a link <a href="http://example.com">http://example.com</a>', … … 378 378 * @ticket 16892 379 379 */ 380 function test_no_segfault() {380 public function test_no_segfault() { 381 381 $in = str_repeat( 'http://example.com/2011/03/18/post-title/', 256 ); 382 382 $out = make_clickable( $in ); … … 387 387 * @ticket 19028 388 388 */ 389 function test_line_break_in_existing_clickable_link() {389 public function test_line_break_in_existing_clickable_link() { 390 390 $html = "<a 391 391 href='mailto:someone@example.com'>someone@example.com</a>";
Note: See TracChangeset
for help on using the changeset viewer.