]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - tests/URLDetectionTest.php
Fix for regression introduced with my last update to the
[quix0rs-gnu-social.git] / tests / URLDetectionTest.php
index 45203bf6e3986f73732f35085d74dbabf58a1457..d83f9faf58e1b296cac5824bc08874dc05595239 100644 (file)
@@ -47,7 +47,9 @@ class URLDetectionTest extends PHPUnit_Framework_TestCase
                      array('127.0.0.1/\'test',
                            '<a href="http://127.0.0.1/\'test" title="http://127.0.0.1/\'test" rel="external">127.0.0.1/\'test</a>'),
                      array('127.0.0.1/"test',
-                           '<a href="http://127.0.0.1/&quot;test" title="http://127.0.0.1/&quot;test" rel="external">127.0.0.1/&quot;test</a>'),
+                           '<a href="http://127.0.0.1/" title="http://127.0.0.1/" rel="external">127.0.0.1/</a>&quot;test'),
+                     array('127.0.0.1/test"test',
+                           '<a href="http://127.0.0.1/test" title="http://127.0.0.1/test" rel="external">127.0.0.1/test</a>&quot;test'),
                      array('127.0.0.1/-test',
                            '<a href="http://127.0.0.1/-test" title="http://127.0.0.1/-test" rel="external">127.0.0.1/-test</a>'),
                      array('127.0.0.1/_test',
@@ -170,6 +172,8 @@ class URLDetectionTest extends PHPUnit_Framework_TestCase
                            '\'<a href="http://example.com/" title="http://example.com/" rel="external">http://example.com</a>\''),
                      array('"http://example.com"',
                            '&quot;<a href="http://example.com/" title="http://example.com/" rel="external">http://example.com</a>&quot;'),
+                     array('"http://example.com/"',
+                           '&quot;<a href="http://example.com/" title="http://example.com/" rel="external">http://example.com/</a>&quot;'),
                      array('http://example.com',
                            '<a href="http://example.com/" title="http://example.com/" rel="external">http://example.com</a>'),
                      array('(http://example.com)',
@@ -181,12 +185,12 @@ class URLDetectionTest extends PHPUnit_Framework_TestCase
                      array('http://example.com/path/(foo)/bar',
                            '<a href="http://example.com/path/(foo)/bar" title="http://example.com/path/(foo)/bar" rel="external">http://example.com/path/(foo)/bar</a>'),
                      array('http://example.com/path/[foo]/bar',
-                           '<a href="http://example.com/path/[foo]/bar" title="http://example.com/path/[foo]/bar" rel="external">http://example.com/path/[foo]/bar</a>'),
+                           '<a href="http://example.com/path/" title="http://example.com/path/" rel="external">http://example.com/path/</a>[foo]/bar'),
                      array('http://example.com/path/foo/(bar)',
                            '<a href="http://example.com/path/foo/(bar)" title="http://example.com/path/foo/(bar)" rel="external">http://example.com/path/foo/(bar)</a>'),
                      //Not a valid url - urls cannot contain unencoded square brackets
                      array('http://example.com/path/foo/[bar]',
-                           '<a href="http://example.com/path/foo/[bar]" title="http://example.com/path/foo/[bar]" rel="external">http://example.com/path/foo/[bar]</a>'),
+                           '<a href="http://example.com/path/foo/" title="http://example.com/path/foo/" rel="external">http://example.com/path/foo/</a>[bar]'),
                      array('Hey, check out my cool site http://example.com okay?',
                            'Hey, check out my cool site <a href="http://example.com/" title="http://example.com/" rel="external">http://example.com</a> okay?'),
                      array('What about parens (e.g. http://example.com/path/foo/(bar))?',