-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from peter279k/test_enhancement
Test enhancement
- Loading branch information
Showing
11 changed files
with
114 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,10 +9,14 @@ | |
{"name": "Jonathan H. Wage", "email": "[email protected]"} | ||
], | ||
"autoload": { | ||
"psr-0": {"Purl": "src/"} | ||
"psr-4": {"Purl\\": "src/Purl"} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": {"Purl\\Test\\": "tests/Purl/Test"} | ||
}, | ||
"require": { | ||
"php": ">=5.3.0", | ||
"jeremykendall/php-domain-parser": "1.3.1" | ||
"jeremykendall/php-domain-parser": "^1.3.1", | ||
"phpunit/phpunit": "^4.8|^5.5|^6.5" | ||
} | ||
} |
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
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
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 |
---|---|---|
|
@@ -2,15 +2,15 @@ | |
|
||
namespace Purl\Test; | ||
|
||
use PHPUnit_Framework_TestCase; | ||
use PHPUnit\Framework\TestCase; | ||
use Purl\Fragment; | ||
use Purl\Parser; | ||
use Purl\ParserInterface; | ||
use Purl\Path; | ||
use Purl\Query; | ||
use Purl\Url; | ||
|
||
class UrlTest extends PHPUnit_Framework_TestCase | ||
class UrlTest extends TestCase | ||
{ | ||
public function testConstruct() | ||
{ | ||
|
@@ -96,6 +96,14 @@ public function testSetPath() | |
$this->assertEquals('about', (string) $url->path); | ||
} | ||
|
||
public function testGetPath() | ||
{ | ||
$url = new Url('http://jwage.com'); | ||
$url->path = 'about'; | ||
$this->assertInstanceOf('Purl\Path', $url->path); | ||
$this->assertEquals('about', (string) $url->getPath()); | ||
} | ||
|
||
public function testSetQuery() | ||
{ | ||
$url = new Url('http://jwage.com'); | ||
|
@@ -105,6 +113,15 @@ public function testSetQuery() | |
$this->assertEquals(array('param1' => 'value1'), $url->query->getData()); | ||
} | ||
|
||
public function testGetQuery() | ||
{ | ||
$url = new Url('http://jwage.com'); | ||
$url->query->set('param1', 'value1'); | ||
$this->assertInstanceOf('Purl\Query', $url->query); | ||
$this->assertEquals('param1=value1', $url->getQuery()); | ||
$this->assertEquals(array('param1' => 'value1'), $url->getQuery()->getData()); | ||
} | ||
|
||
public function testSetFragment() | ||
{ | ||
$url = new Url('http://jwage.com'); | ||
|
@@ -113,6 +130,14 @@ public function testSetFragment() | |
$this->assertEquals('http://jwage.com/#about?param1=value1', (string) $url); | ||
} | ||
|
||
public function testGetFragment() | ||
{ | ||
$url = new Url('http://jwage.com'); | ||
$url->fragment->path = 'about'; | ||
$url->fragment->query->set('param1', 'value1'); | ||
$this->assertEquals('about?param1=value1', (string) $url->getFragment()); | ||
} | ||
|
||
public function testGetNetloc() | ||
{ | ||
$url = new Url('https://user:[email protected]:443'); | ||
|
This file was deleted.
Oops, something went wrong.