File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 7
7
8
8
use Mvc5 \Cookie \HttpCookies ;
9
9
use Mvc5 \Test \Test \TestCase ;
10
+ use PHPUnit \Framework \Error \Notice ;
10
11
11
12
use const Mvc5 \Cookie \Config \EXPIRE_TIME ;
12
13
@@ -176,4 +177,40 @@ function test_without_associative_array_with_options()
176
177
$ this ->assertNotEquals ($ cookies , $ new );
177
178
$ this ->assertEquals ($ expired , $ new ['foo ' ]);
178
179
}
180
+
181
+ /**
182
+ *
183
+ */
184
+ function test_invalid_name ()
185
+ {
186
+ $ cookies = new HttpCookies ;
187
+
188
+ try {
189
+
190
+ $ cookies ->without ([]);
191
+
192
+ } catch (Notice $ e ) {
193
+
194
+ $ this ->assertEquals ('Undefined offset: 0 ' , $ e ->getMessage ());
195
+
196
+ }
197
+ }
198
+
199
+ /**
200
+ *
201
+ */
202
+ function test_invalid_associative_name ()
203
+ {
204
+ $ cookies = new HttpCookies ;
205
+
206
+ try {
207
+
208
+ $ cookies ->without (['value ' => '' ]);
209
+
210
+ } catch (Notice $ e ) {
211
+
212
+ $ this ->assertEquals ('Undefined index: name ' , $ e ->getMessage ());
213
+
214
+ }
215
+ }
179
216
}
You can’t perform that action at this time.
0 commit comments