@@ -96,17 +96,17 @@ public static function assertResponseCookieValueSame(string $name, string $expec
96
96
97
97
public static function assertBrowserHasCookie (string $ name , string $ path = '/ ' , string $ domain = null , string $ message = '' ): void
98
98
{
99
- self ::assertThat ( self :: getClient (), new BrowserKitConstraint \BrowserHasCookie ($ name , $ path , $ domain ), $ message );
99
+ self ::assertThatForClient ( new BrowserKitConstraint \BrowserHasCookie ($ name , $ path , $ domain ), $ message );
100
100
}
101
101
102
102
public static function assertBrowserNotHasCookie (string $ name , string $ path = '/ ' , string $ domain = null , string $ message = '' ): void
103
103
{
104
- self ::assertThat ( self :: getClient (), new LogicalNot (new BrowserKitConstraint \BrowserHasCookie ($ name , $ path , $ domain )), $ message );
104
+ self ::assertThatForClient ( new LogicalNot (new BrowserKitConstraint \BrowserHasCookie ($ name , $ path , $ domain )), $ message );
105
105
}
106
106
107
107
public static function assertBrowserCookieValueSame (string $ name , string $ expectedValue , bool $ raw = false , string $ path = '/ ' , string $ domain = null , string $ message = '' ): void
108
108
{
109
- self ::assertThat ( self :: getClient (), LogicalAnd::fromConstraints (
109
+ self ::assertThatForClient ( LogicalAnd::fromConstraints (
110
110
new BrowserKitConstraint \BrowserHasCookie ($ name , $ path , $ domain ),
111
111
new BrowserKitConstraint \BrowserCookieValueSame ($ name , $ expectedValue , $ raw , $ path , $ domain )
112
112
), $ message );
@@ -146,6 +146,11 @@ public static function assertThatForResponse(Constraint $constraint, string $mes
146
146
}
147
147
}
148
148
149
+ public static function assertThatForClient (Constraint $ constraint , string $ message = '' ): void
150
+ {
151
+ self ::assertThat (self ::getClient (), $ constraint , $ message );
152
+ }
153
+
149
154
private static function getClient (AbstractBrowser $ newClient = null ): ?AbstractBrowser
150
155
{
151
156
static $ client ;
0 commit comments