@@ -40,29 +40,47 @@ public static function setUpBeforeClass(): void
40
40
self ::$ session = self ::$ driver ->createSession ();
41
41
}
42
42
43
+ /**
44
+ * @param list<string>|string|null $forceScheme
45
+ */
43
46
public function getSession (array |string |null $ forceScheme = null ): Session
44
47
{
45
48
$ this ->skipUnsupportedScheme ($ forceScheme );
46
49
47
50
return self ::$ session ;
48
51
}
49
52
53
+ /**
54
+ * @param list<string>|string|null $forceScheme
55
+ */
50
56
public function getUri (array |string |null $ forceScheme = null ): Uri
51
57
{
52
58
$ this ->skipUnsupportedScheme ($ forceScheme );
53
59
54
60
return self ::$ uri ;
55
61
}
56
62
63
+ /**
64
+ * @param list<string>|string|null $forceScheme
65
+ */
57
66
private function skipUnsupportedScheme (array |string |null $ forceScheme ): void
58
67
{
68
+ if ($ forceScheme === null ) {
69
+ return ;
70
+ }
71
+
59
72
if (is_string ($ forceScheme )) {
60
73
$ forceScheme = [$ forceScheme ];
61
74
}
62
75
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 )) {
66
84
/** @psalm-suppress MixedArgumentTypeCoercion */
67
85
$ this ->markTestSkipped (sprintf (
68
86
'Connection only for types: "%s" ' ,
@@ -71,6 +89,9 @@ private function skipUnsupportedScheme(array|string|null $forceScheme): void
71
89
}
72
90
}
73
91
92
+ /**
93
+ * @param list<string>|string|null $forceScheme
94
+ */
74
95
protected function getDriver (array |string |null $ forceScheme = null ): Driver
75
96
{
76
97
$ this ->skipUnsupportedScheme ($ forceScheme );
0 commit comments