Skip to content

Commit dee9d30

Browse files
committed
test: Add additional tests
1 parent 6c5e6f2 commit dee9d30

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/system/HTTP/Parameters/ParametersTest.php

+26
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
namespace CodeIgniter\HTTP\Parameters;
1515

16+
use CodeIgniter\Exceptions\RuntimeException;
1617
use CodeIgniter\Test\CIUnitTestCase;
1718
use PHPUnit\Framework\Attributes\Group;
1819
use stdClass;
@@ -60,6 +61,7 @@ public function testCreateEmptyParameters(): void
6061
$parameters = new Parameters();
6162

6263
$this->assertSame([], $parameters->all());
64+
$this->assertSame([], $parameters->keys());
6365
}
6466

6567
public function testGetValues(): void
@@ -164,4 +166,28 @@ public function testCount(): void
164166

165167
$this->assertCount(count($this->original) - 2, $parameters);
166168
}
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+
}
167193
}

0 commit comments

Comments
 (0)