This repository has been archived by the owner on Jan 16, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix bug: transposing a parsed uri forgets any parameters changed in q…
…uery string
- Loading branch information
mikey179
committed
Oct 3, 2014
1 parent
1c00b61
commit c894c45
Showing
3 changed files
with
52 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
/** | ||
* This file is part of stubbles. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @package stubbles | ||
*/ | ||
namespace stubbles\peer; | ||
/** | ||
* Test for stubbles\peer\ParsedUri. | ||
* | ||
* @group peer | ||
* @since 5.1.1 | ||
*/ | ||
class ParsedUriTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @test | ||
*/ | ||
public function transposeKeepsChangedParameters() | ||
{ | ||
$parsedUri = new ParsedUri('http://example.com/?foo=bar&baz=303'); | ||
$parsedUri->queryString()->addParam('baz', '313'); | ||
$parsedUri->queryString()->addParam('dummy', 'example'); | ||
$this->assertEquals( | ||
'https://example.com/?foo=bar&baz=313&dummy=example', | ||
$parsedUri->transpose(['scheme' => 'https'])->asStringWithoutPort() | ||
); | ||
} | ||
} |