public function InputBagTest::testAll in Drupal 9
@covers ::all
File
- core/
tests/ Drupal/ Tests/ Core/ Http/ InputBagTest.php, line 19
Class
- InputBagTest
- @coversDefaultClass \Drupal\Core\Http\InputBag
Namespace
Drupal\Tests\Core\HttpCode
public function testAll() {
$input = [
'bad' => 'bad',
'good' => [
'good',
],
];
$input_bag = new InputBag();
$input_bag
->replace($input);
$this
->assertSame($input_bag
->all(), $input);
$this
->assertSame($input_bag
->all('good'), [
'good',
]);
$this
->expectException(\UnexpectedValueException::class);
$input_bag
->all('bad');
}