diff --git a/composer.json b/composer.json index 32aacc2..442d594 100644 --- a/composer.json +++ b/composer.json @@ -13,6 +13,6 @@ }, "require": { "php": ">=5.3.0", - "jeremykendall/php-domain-parser": "~1.3" + "jeremykendall/php-domain-parser": "~1.4" } } diff --git a/tests/Purl/Test/PublicSuffixListTest.php b/tests/Purl/Test/PublicSuffixListTest.php index 4d2ea38..b6c5cd6 100644 --- a/tests/Purl/Test/PublicSuffixListTest.php +++ b/tests/Purl/Test/PublicSuffixListTest.php @@ -22,23 +22,38 @@ public function parseDataProvider() { return array( array('http://www.waxaudio.com.au/audio/albums/the_mashening', 'com.au', 'waxaudio.com.au', 'www', 'www.waxaudio.com.au'), - array('http://example.com', 'com', 'example.com', null, 'example.com'), - array('http://giant.yyyy', 'yyyy', 'giant.yyyy', null, 'giant.yyyy'), - array('http://cea-law.co.il', 'co.il', 'cea-law.co.il', null, 'cea-law.co.il'), + array('example.COM', 'com', 'example.com', null, 'example.com'), + array('giant.yyyy', 'yyyy', 'giant.yyyy', null, 'giant.yyyy'), + array('cea-law.co.il', 'co.il', 'cea-law.co.il', null, 'cea-law.co.il'), array('http://edition.cnn.com/WORLD/', 'com', 'cnn.com', 'edition', 'edition.cnn.com'), array('http://en.wikipedia.org/', 'org', 'wikipedia.org', 'en', 'en.wikipedia.org'), - array('http://a.b.c.cy', 'c.cy', 'b.c.cy', 'a', 'a.b.c.cy'), + array('a.b.c.cy', 'c.cy', 'b.c.cy', 'a', 'a.b.c.cy'), array('https://test.k12.ak.us', 'k12.ak.us', 'test.k12.ak.us', null, 'test.k12.ak.us'), - array('http://www.scottwills.co.uk', 'co.uk', 'scottwills.co.uk', 'www', 'www.scottwills.co.uk'), - array('http://b.ide.kyoto.jp', 'ide.kyoto.jp', 'b.ide.kyoto.jp', null, 'b.ide.kyoto.jp'), - array('http://a.b.example.uk.com', 'uk.com', 'example.uk.com', 'a.b', 'a.b.example.uk.com'), - array('http://test.nic.ar', 'ar', 'nic.ar', 'test', 'test.nic.ar'), - array('http://a.b.test.om', 'test.om', 'b.test.om', 'a', 'a.b.test.om'), - array('http://baez.songfest.om', 'om', 'songfest.om', 'baez', 'baez.songfest.om'), - array('http://politics.news.omanpost.om', 'om', 'omanpost.om', 'politics.news', 'politics.news.omanpost.om'), - array('http://test.museum', 'museum', 'test.museum', null, 'test.museum'), - array('http://bob.smith.name', 'name', 'smith.name', 'bob', 'bob.smith.name'), - array('http://tons.of.info', 'info', 'of.info', 'tons', 'tons.of.info') + array('www.scottwills.co.uk', 'co.uk', 'scottwills.co.uk', 'www', 'www.scottwills.co.uk'), + array('b.ide.kyoto.jp', 'ide.kyoto.jp', 'b.ide.kyoto.jp', null, 'b.ide.kyoto.jp'), + array('a.b.example.uk.com', 'uk.com', 'example.uk.com', 'a.b', 'a.b.example.uk.com'), + array('test.nic.ar', 'ar', 'nic.ar', 'test', 'test.nic.ar'), + array('a.b.test.ck', 'test.ck', 'b.test.ck', 'a', 'a.b.test.ck'), + array('baez.songfest.om', 'om', 'songfest.om', 'baez', 'baez.songfest.om'), + array('politics.news.omanpost.om', 'om', 'omanpost.om', 'politics.news', 'politics.news.omanpost.om'), + array('us.example.com', 'com', 'example.com', 'us', 'us.example.com'), + array('us.example.na', 'na', 'example.na', 'us', 'us.example.na'), + array('www.example.us.na', 'us.na', 'example.us.na', 'www', 'www.example.us.na'), + array('us.example.org', 'org', 'example.org', 'us', 'us.example.org'), + array('webhop.broken.biz', 'biz', 'broken.biz', 'webhop', 'webhop.broken.biz'), + array('www.broken.webhop.biz', 'webhop.biz', 'broken.webhop.biz', 'www', 'www.broken.webhop.biz'), + array('//www.broken.webhop.biz', 'webhop.biz', 'broken.webhop.biz', 'www', 'www.broken.webhop.biz'), + array('ftp://www.waxaudio.com.au/audio/albums/the_mashening', 'com.au', 'waxaudio.com.au', 'www', 'www.waxaudio.com.au'), + array('ftps://test.k12.ak.us', 'k12.ak.us', 'test.k12.ak.us', null, 'test.k12.ak.us'), + array('http://localhost', null, null, null, 'localhost'), + array('test.museum', 'museum', 'test.museum', null, 'test.museum'), + array('bob.smith.name', 'name', 'smith.name', 'bob', 'bob.smith.name'), + array('tons.of.info', 'info', 'of.info', 'tons', 'tons.of.info'), + array('http://Яндекс.РФ', 'рф', 'яндекс.рф', null, 'яндекс.рф'), + array('www.食狮.中国', '中国', '食狮.中国', 'www', 'www.食狮.中国'), + array('食狮.com.cn', 'com.cn', '食狮.com.cn', null, '食狮.com.cn'), + array('www.xn--85x722f.xn--fiqs8s', 'xn--fiqs8s', 'xn--85x722f.xn--fiqs8s', 'www', 'www.xn--85x722f.xn--fiqs8s'), + array('xn--85x722f.com.cn', 'com.cn', 'xn--85x722f.com.cn', null, 'xn--85x722f.com.cn'), ); } }