-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for PHPUnit 10 and PHPUnit 11
- Loading branch information
Showing
33 changed files
with
345 additions
and
716 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,20 +16,19 @@ | |
use League\Uri\Http; | ||
use League\Uri\Uri; | ||
use League\Uri\UriString; | ||
use PHPUnit\Framework\Attributes\CoversClass; | ||
use PHPUnit\Framework\Attributes\DataProvider; | ||
use PHPUnit\Framework\Attributes\Group; | ||
use PHPUnit\Framework\TestCase; | ||
use Psr\Http\Message\UriInterface as Psr7UriInterface; | ||
|
||
use function parse_url; | ||
|
||
/** | ||
* @group userinfo | ||
* @coversDefaultClass \League\Uri\Components\Authority | ||
*/ | ||
#[CoversClass(Authority::class)] | ||
#[Group('userinfo')] | ||
final class AuthorityTest extends TestCase | ||
{ | ||
/** | ||
* @dataProvider validAuthorityDataProvider | ||
*/ | ||
#[DataProvider('validAuthorityDataProvider')] | ||
public function testConstructor( | ||
?string $authority, | ||
?string $host, | ||
|
@@ -90,9 +89,7 @@ public static function validAuthorityDataProvider(): array | |
]; | ||
} | ||
|
||
/** | ||
* @dataProvider invalidAuthorityDataProvider | ||
*/ | ||
#[DataProvider('invalidAuthorityDataProvider')] | ||
public function testConstructorFails(string $authority): void | ||
{ | ||
$this->expectException(SyntaxError::class); | ||
|
@@ -116,9 +113,7 @@ public function testWithHost(): void | |
self::assertNotEquals($authority, $authority->withHost('[::1]')); | ||
} | ||
|
||
/** | ||
* @dataProvider invalidHostDataProvider | ||
*/ | ||
#[DataProvider('invalidHostDataProvider')] | ||
public function testWithHostFails(?string $host): void | ||
{ | ||
$this->expectException(SyntaxError::class); | ||
|
@@ -164,9 +159,7 @@ public function testWithUserInfoFails(): void | |
Authority::new('foo:[email protected]:443')->withUserInfo("\0foo", 'bar'); | ||
} | ||
|
||
/** | ||
* @dataProvider stringRepresentationDataProvider | ||
*/ | ||
#[DataProvider('stringRepresentationDataProvider')] | ||
public function testAuthorityStringRepresentation( | ||
?string $authority, | ||
string $string, | ||
|
@@ -220,9 +213,7 @@ public static function stringRepresentationDataProvider(): array | |
]; | ||
} | ||
|
||
/** | ||
* @dataProvider getURIProvider | ||
*/ | ||
#[DataProvider('getURIProvider')] | ||
public function testCreateFromUri(UriInterface|Psr7UriInterface $uri, ?string $expected, array $components): void | ||
{ | ||
$authority = Authority::fromUri($uri); | ||
|
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
Oops, something went wrong.