File tree 1 file changed +26
-0
lines changed
tests/system/HTTP/Parameters
1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 13
13
14
14
namespace CodeIgniter \HTTP \Parameters ;
15
15
16
+ use CodeIgniter \Exceptions \RuntimeException ;
16
17
use CodeIgniter \Test \CIUnitTestCase ;
17
18
use PHPUnit \Framework \Attributes \Group ;
18
19
use stdClass ;
@@ -60,6 +61,7 @@ public function testCreateEmptyParameters(): void
60
61
$ parameters = new Parameters ();
61
62
62
63
$ this ->assertSame ([], $ parameters ->all ());
64
+ $ this ->assertSame ([], $ parameters ->keys ());
63
65
}
64
66
65
67
public function testGetValues (): void
@@ -164,4 +166,28 @@ public function testCount(): void
164
166
165
167
$ this ->assertCount (count ($ this ->original ) - 2 , $ parameters );
166
168
}
169
+
170
+ public function testGetAll (): void
171
+ {
172
+ $ parameters = new Parameters ($ this ->original );
173
+
174
+ $ this ->assertSame ($ this ->original , $ parameters ->all ());
175
+ $ this ->assertSame (
176
+ [
177
+ 'vendor/bin/phpunit ' ,
178
+ './tests/ParametersTest.php ' ,
179
+ '--no-coverage ' ,
180
+ ],
181
+ $ parameters ->all ('argv ' ),
182
+ );
183
+ }
184
+
185
+ public function testAttemptGetAllNonIterableValues (): void
186
+ {
187
+ $ parameters = new Parameters ($ this ->original );
188
+
189
+ $ this ->expectException (RuntimeException::class);
190
+
191
+ $ parameters ->all ('argc ' );
192
+ }
167
193
}
You can’t perform that action at this time.
0 commit comments