File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -239,6 +239,38 @@ function it_matches_other_cookies()
239
239
$ this ->match ($ notMatches )->shouldReturn (false );
240
240
}
241
241
242
+ function it_validates_itself ()
243
+ {
244
+ $ this ->isValid ()->shouldReturn (true );
245
+ }
246
+
247
+ /**
248
+ * @dataProvider invalidCharacterExamples
249
+ */
250
+ function it_can_be_constructed_without_name_validation ($ name , $ invalid )
251
+ {
252
+ $ this ->beConstructedThrough ('createWithoutValidation ' , [$ name ]);
253
+
254
+ $ this ->isValid ()->shouldReturn (!$ invalid );
255
+ }
256
+
257
+ /**
258
+ * @dataProvider invalidCharacterExamples
259
+ */
260
+ function it_can_be_constructed_without_value_validation ($ value , $ invalid )
261
+ {
262
+ $ this ->beConstructedThrough ('createWithoutValidation ' , ['name ' , $ value ]);
263
+
264
+ $ this ->isValid ()->shouldReturn (!$ invalid );
265
+ }
266
+
267
+ function it_can_be_constructed_without_max_age_validation ()
268
+ {
269
+ $ this ->beConstructedThrough ('createWithoutValidation ' , ['name ' , 'value ' , '-1 ' ]);
270
+
271
+ $ this ->isValid ()->shouldReturn (false );
272
+ }
273
+
242
274
/**
243
275
* Provides examples for invalid characers in names and values.
244
276
*
You can’t perform that action at this time.
0 commit comments