diff options
author | Craig Andrews <candrews@integralblue.com> | 2009-08-25 14:12:31 -0400 |
---|---|---|
committer | Craig Andrews <candrews@integralblue.com> | 2009-08-25 14:12:31 -0400 |
commit | 210bc4248b5e0c8bd577ac51c2f8df9ac05166ae (patch) | |
tree | 5a0423f37b95c9a0eea64f538ccfb5b58bb69ba3 /tests | |
parent | 6a3a25b5a2b65e54841cc60c4f2254f6d7b6b54b (diff) |
All tests pass except for those that require matching parens or brackets
Diffstat (limited to 'tests')
-rw-r--r-- | tests/URLDetectionTest.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/URLDetectionTest.php b/tests/URLDetectionTest.php index 05c02d6bb..7b2e8c5ae 100644 --- a/tests/URLDetectionTest.php +++ b/tests/URLDetectionTest.php @@ -25,16 +25,24 @@ class URLDetectionTest extends PHPUnit_Framework_TestCase static public function provider() { return array( + array('http://127.0.0.1', + '<a href="http://127.0.0.1/" rel="external">http://127.0.0.1</a>'), array('127.0.0.1', '<a href="http://127.0.0.1/" rel="external">127.0.0.1</a>'), + array('127.0.0.1:99', + '<a href="http://127.0.0.1:99/" rel="external">127.0.0.1:99</a>'), array('127.0.0.1/test.php', '<a href="http://127.0.0.1/test.php" rel="external">127.0.0.1/test.php</a>'), + array('http://[::1]:99/test.php', + '<a href="http://[::1]:99/test.php" rel="external">http://[::1]:99/test.php</a>'), array('http://::1/test.php', '<a href="http://::1/test.php" rel="external">http://::1/test.php</a>'), array('http://::1', '<a href="http://::1/" rel="external">http://::1</a>'), array('2001:4978:1b5:0:21d:e0ff:fe66:59ab/test.php', '<a href="http://2001:4978:1b5:0:21d:e0ff:fe66:59ab/test.php" rel="external">2001:4978:1b5:0:21d:e0ff:fe66:59ab/test.php</a>'), + array('[2001:4978:1b5:0:21d:e0ff:fe66:59ab]:99/test.php', + '<a href="http://[2001:4978:1b5:0:21d:e0ff:fe66:59ab]:99/test.php" rel="external">[2001:4978:1b5:0:21d:e0ff:fe66:59ab]:99/test.php</a>'), array('2001:4978:1b5:0:21d:e0ff:fe66:59ab', '<a href="http://2001:4978:1b5:0:21d:e0ff:fe66:59ab/" rel="external">2001:4978:1b5:0:21d:e0ff:fe66:59ab</a>'), array('http://127.0.0.1', @@ -145,14 +153,13 @@ class URLDetectionTest extends PHPUnit_Framework_TestCase '<<a href="http://example.com/" rel="external">http://example.com</a>>'), array('http://example.com/path/(foo)/bar', '<a href="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" rel="external">http://example.com/path/[foo]/bar</a>'), array('http://example.com/path/foo/(bar)', '<a href="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]" rel="external">http://example.com/path/foo/[bar]</a>'), + array('http://example.com/path/foo/[bar]', + '<a href="http://example.com/path/foo/[bar]" rel="external">http://example.com/path/foo/[bar]</a>'), array('Hey, check out my cool site http://example.com okay?', 'Hey, check out my cool site <a href="http://example.com/" rel="external">http://example.com</a> okay?'), array('What about parens (e.g. http://example.com/path/foo/(bar))?', |