Browse Source

Add an extra Assertion to testStripLinks() method for checking "javascript:void(0)"

sohelrana820 8 years ago
parent
commit
79ef34430d
1 changed files with 5 additions and 0 deletions
  1. 5 0
      tests/TestCase/Utility/TextTest.php

+ 5 - 0
tests/TestCase/Utility/TextTest.php

@@ -845,6 +845,11 @@ HTML;
         $result = $this->Text->stripLinks($text);
         $this->assertEquals($expected, $result);
 
+        $text = 'This <strong><a href="#">is</a></strong> a <a href="javascript:void(0)">test</a> text';
+        $expected = 'This <strong>is</strong> a test text';
+        $result = $this->Text->stripLinks($text);
+        $this->assertEquals($expected, $result);
+
         $text = '<a<a h> href=\'bla\'>test</a</a>>';
         $this->assertEquals('test', $this->Text->stripLinks($text));