Skip to content

Commit

Permalink
Improve type casting
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Jul 8, 2024
1 parent f3c645e commit c28c29c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Components/SchemeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,18 @@ public static function getURIProvider(): iterable
public function it_can_detect_information_about_special_schemes(
?string $scheme,
bool $isHttp,
bool $isWebsocket,
bool $isSsl,
bool $isSpecial,
Port $defaultPort,
): void {
self::assertSame($isHttp, Scheme::new($scheme)->isHttp());
self::assertSame($isSsl, Scheme::new($scheme)->isSsl());
self::assertSame($isSpecial, Scheme::new($scheme)->isSpecial());
self::assertSame($defaultPort, Scheme::new($scheme)->defaultPort());
$schemeObject = Scheme::new($scheme);

self::assertSame($isHttp, $schemeObject->isHttp());
self::assertSame($isWebsocket, $schemeObject->isWebsocket());
self::assertSame($isSsl, $schemeObject->isSsl());
self::assertSame($isSpecial, $schemeObject->isSpecial());
self::assertSame($defaultPort, $schemeObject->defaultPort());
}

public static function getSchemeInfoProvider(): \Generator
Expand All @@ -135,7 +139,7 @@ public static function getSchemeInfoProvider(): \Generator
yield 'detect an WSS URL' => [
'scheme' => 'wss',
'isHttp' => false,
'isWebsocket' => false,
'isWebsocket' => true,
'isSsl' => true,
'isSpecial' => true,
Port::new(443),
Expand Down

0 comments on commit c28c29c

Please sign in to comment.