%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 49.231.201.246 / Your IP : 216.73.216.149 Web Server : Apache/2.4.18 (Ubuntu) System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : root ( 0) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/11584/cwd/html/ppaobm/vendor/codeception/base/tests/unit/Codeception/Util/ |
Upload File : |
<?php namespace Codeception\Util; class UriTest extends \Codeception\Test\Unit { // tests public function testUrlMerge() { $this->assertEquals( 'http://codeception.com/quickstart', Uri::mergeUrls('http://codeception.com/hello', '/quickstart'), 'merge paths' ); $this->assertEquals( 'http://codeception.com/hello/davert', Uri::mergeUrls('http://codeception.com/hello/world', 'davert'), 'merge relative urls' ); $this->assertEquals( 'https://github.com/codeception/codeception', Uri::mergeUrls('http://codeception.com/hello/world', 'https://github.com/codeception/codeception'), 'merge absolute urls' ); } /** * @Issue https://github.com/Codeception/Codeception/pull/2141 */ public function testMergingScheme() { $this->assertEquals( 'https://google.com/account/', Uri::mergeUrls('http://google.com/', 'https://google.com/account/') ); $this->assertEquals('https://facebook.com/', Uri::mergeUrls('https://google.com/test/', '//facebook.com/')); $this->assertEquals( 'https://facebook.com/#anchor2', Uri::mergeUrls('https://google.com/?param=1#anchor', '//facebook.com/#anchor2') ); } /** * @Issue https://github.com/Codeception/Codeception/pull/2841 */ public function testMergingPath() { $this->assertEquals('/form/?param=1#anchor', Uri::mergeUrls('/form/?param=1', '#anchor')); $this->assertEquals('/form/?param=1#anchor2', Uri::mergeUrls('/form/?param=1#anchor1', '#anchor2')); $this->assertEquals('/form/?param=2', Uri::mergeUrls('/form/?param=1#anchor', '?param=2')); $this->assertEquals('/page/', Uri::mergeUrls('/form/?param=1#anchor', '/page/')); } /** * @Issue https://github.com/Codeception/Codeception/pull/4847 */ public function testMergingNonParsingPath() { $this->assertEquals('/3.0/en/index/page:5', Uri::mergeUrls('https://cakephp.org/', '/3.0/en/index/page:5')); } /** * @Issue https://github.com/Codeception/Codeception/pull/2499 */ public function testAppendAnchor() { $this->assertEquals( 'http://codeception.com/quickstart#anchor', Uri::appendPath('http://codeception.com/quickstart', '#anchor') ); $this->assertEquals( 'http://codeception.com/quickstart#anchor', Uri::appendPath('http://codeception.com/quickstart#first', '#anchor') ); } public function testAppendPath() { $this->assertEquals( 'http://codeception.com/quickstart/path', Uri::appendPath('http://codeception.com/quickstart', 'path') ); $this->assertEquals( 'http://codeception.com/quickstart/path', Uri::appendPath('http://codeception.com/quickstart', '/path') ); } public function testAppendEmptyPath() { $this->assertEquals( 'http://codeception.com/quickstart', Uri::appendPath('http://codeception.com/quickstart', '') ); } public function testAppendPathRemovesQueryStringAndAnchor() { $this->assertEquals( 'http://codeception.com/quickstart', Uri::appendPath('http://codeception.com/quickstart?a=b#c', '') ); } public function testMergeUrlsWhenBaseUriHasNoTrailingSlashAndUriPathHasNoLeadingSlash() { $this->assertEquals( 'http://codeception.com/test', Uri::mergeUrls('http://codeception.com', 'test')); } public function testMergeUrlsWhenBaseUriEndsWithSlashButUriPathHasNoLeadingSlash() { $this->assertEquals( 'http://codeception.com/test', Uri::mergeUrls('http://codeception.com/', 'test')); } }