function InputBagTest::testAll

@covers ::all

File

core/tests/Drupal/Tests/Core/Http/InputBagTest.php, line 19

Class

InputBagTest
@coversDefaultClass \Drupal\Core\Http\InputBag

Namespace

Drupal\Tests\Core\Http

Code

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');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.