Browse files

MDL-21168 - Added test for URLs with encoded paths and queries

  • Loading branch information...
1 parent 1bef863 commit fe8525e86b68959cacf55ada426806f438851604 @stronk7 stronk7 committed Jan 12, 2010
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/simpletest/testweblib.php
@@ -166,7 +166,7 @@ function test_convert_urls_into_links() {
'This is a story about moodle.coming to a cinema near you.'=>'This is a story about moodle.coming to a cinema near you.',
//URLs containing utf 8 characters
'http://Iñtërnâtiônàlizætiøô=nëø'=>'<a href="http://Iñtërnâtiônàlizætiøô=nëø" target="_blank">http://Iñtërnâtiônàlizætiøô=nëø</a>',
- 'www.Iñtërnâtiônàlizætiøô=nëø'=>'<a href="http://www.Iñtërnâtiônàlizætiøô=nëø" target="_blank">http://www.Iñtërnâtiônàlizætiøô=nëø</a>',
+ 'www.Iñtërnâtiônàlizætiøô=nëø'=>'<a href="http://www.Iñtërnâtiônàlizætiøô=nëø" target="_blank">www.Iñtërnâtiônàlizætiøô=nëø</a>',
//text containing utf 8 characters outside of a url
'Iñtërnâtiônàlizætiøn is important to'=>'Iñtërnâtiônàlizætiøn is important to <a href="" target="_blank"></a>',
//too hard to identify without additional regexs
@@ -190,6 +190,12 @@ function test_convert_urls_into_links() {
htmlspecialchars('fully escaped img tag <img src="" />') => 'fully escaped img tag &lt;img src="" /&gt;',
//Double http with www
'One more link like to test' => 'One more link like <a href="" target="_blank"></a> to test',
+ //Encoded URLs in the path
+ 'URL:' => 'URL: <a href="" target="_blank"></a>',
+ 'URL:' => 'URL: <a href="" target="_blank"></a>',
+ //Encoded URLs in the query
+ 'URL:' => 'URL: <a href="" target="_blank"></a>',
+ 'URL:' => 'URL: <a href="" target="_blank"></a>',
//URLs in Javascript
'var url="";'=>'var url="";',
'var url = "";'=>'var url = "";',

0 comments on commit fe8525e

Please sign in to comment.