Skip to content

Commit 4a6be71

Browse files
committed
allow schemes with ssl configs as well
1 parent 58e221f commit 4a6be71

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

tests/Integration/EnvironmentAwareIntegrationTest.php

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,29 +40,47 @@ public static function setUpBeforeClass(): void
4040
self::$session = self::$driver->createSession();
4141
}
4242

43+
/**
44+
* @param list<string>|string|null $forceScheme
45+
*/
4346
public function getSession(array|string|null $forceScheme = null): Session
4447
{
4548
$this->skipUnsupportedScheme($forceScheme);
4649

4750
return self::$session;
4851
}
4952

53+
/**
54+
* @param list<string>|string|null $forceScheme
55+
*/
5056
public function getUri(array|string|null $forceScheme = null): Uri
5157
{
5258
$this->skipUnsupportedScheme($forceScheme);
5359

5460
return self::$uri;
5561
}
5662

63+
/**
64+
* @param list<string>|string|null $forceScheme
65+
*/
5766
private function skipUnsupportedScheme(array|string|null $forceScheme): void
5867
{
68+
if ($forceScheme === null) {
69+
return;
70+
}
71+
5972
if (is_string($forceScheme)) {
6073
$forceScheme = [$forceScheme];
6174
}
6275

63-
if ($forceScheme !== null &&
64-
!in_array(self::$uri->getScheme(), $forceScheme)
65-
) {
76+
$options = [];
77+
foreach ($forceScheme as $scheme) {
78+
$options[] = $scheme;
79+
$options[] = $scheme.'+s';
80+
$options[] = $scheme.'+ssc';
81+
}
82+
83+
if (!in_array(self::$uri->getScheme(), $options)) {
6684
/** @psalm-suppress MixedArgumentTypeCoercion */
6785
$this->markTestSkipped(sprintf(
6886
'Connection only for types: "%s"',
@@ -71,6 +89,9 @@ private function skipUnsupportedScheme(array|string|null $forceScheme): void
7189
}
7290
}
7391

92+
/**
93+
* @param list<string>|string|null $forceScheme
94+
*/
7495
protected function getDriver(array|string|null $forceScheme = null): Driver
7596
{
7697
$this->skipUnsupportedScheme($forceScheme);

0 commit comments

Comments
 (0)