From 2624695f71f212f67b16903751369d9b3f6620e9 Mon Sep 17 00:00:00 2001 From: Renatho De Carli Rosa Date: Mon, 11 Nov 2024 16:11:50 -0300 Subject: [PATCH] Add test --- projects/plugins/wpcomsh/tests/test-wpcomsh.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/projects/plugins/wpcomsh/tests/test-wpcomsh.php b/projects/plugins/wpcomsh/tests/test-wpcomsh.php index 524d985812021..354a60c0bdc12 100644 --- a/projects/plugins/wpcomsh/tests/test-wpcomsh.php +++ b/projects/plugins/wpcomsh/tests/test-wpcomsh.php @@ -29,6 +29,8 @@ public function test_wpcomsh_make_content_clickable() { $div_skip = '
https://wp.com
'; $custom_element = 'https://wp.com'; $custom_element_starts_with_pre = 'https://wp.com'; + $link_inside_tag_inside_attr = ' +
  • '; $original_content = '' . $script . @@ -40,7 +42,8 @@ public function test_wpcomsh_make_content_clickable() { $textarea . $div_skip . $custom_element . - $custom_element_starts_with_pre; + $custom_element_starts_with_pre . + $link_inside_tag_inside_attr; $expected_output = '' . '' . @@ -52,7 +55,8 @@ public function test_wpcomsh_make_content_clickable() { '' . '
    https://wp.com
    ' . 'https://wp.com' . // Made clickable - 'https://wp.com'; // Made clickable even if it starts with `https://wp.com' . // Made clickable even if it starts with `'; // Don't make clickable if it's inside a tag inside an attribute. $this->assertEquals( $expected_output, wpcomsh_make_content_clickable( $original_content ) ); }