return true;
} ));
$container =
new ContainerBuilder();
$container->
set('router',
$router);
$container->
set('request_stack',
$stack);
$container->
set(RequestTransformerInterface::
class,
$requestTransformer);
$container->
set('http_kernel',
$kernel);
$this->controller->
setContainer($container);
$this->controller->
testForwardToRoute('foo',
['foo' => 'bar'
],
['foo' => 'bar'
]);
} public function testDecodeParamJson(): void
{ $request =
new Request(['foobar' => '{"foo": "bar", "bar": "baz"}'
]);
$params =
$this->controller->
testDecodeParam($request, 'foobar'
);
static::
assertCount(2,
$params);
static::
assertArrayHasKey('foo',
$params);
static::
assertSame('bar',
$params['foo'
]);