class InputBagTest
@coversDefaultClass \Drupal\Core\Http\InputBag
@group Http
Hierarchy
- class \Drupal\Tests\UnitTestCase uses \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\Core\Http\InputBagTest extends \Drupal\Tests\UnitTestCase
Expanded class hierarchy of InputBagTest
File
-
core/
tests/ Drupal/ Tests/ Core/ Http/ InputBagTest.php, line 14
Namespace
Drupal\Tests\Core\HttpView source
class InputBagTest extends UnitTestCase {
/**
* @covers ::all
*/
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');
}
/**
* @coversNothing
* @todo Remove this when Symfony 4 is no longer supported.
*/
public function testRequestFactory() {
$request = Request::create('');
$this->assertInstanceOf(InputBag::class, $request->query);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.