public function InlineFragmentRendererTest::testRenderWithObjectsAsAttributesPassedAsObjectsInTheController in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/http-kernel/Tests/Fragment/InlineFragmentRendererTest.php \Symfony\Component\HttpKernel\Tests\Fragment\InlineFragmentRendererTest::testRenderWithObjectsAsAttributesPassedAsObjectsInTheController()
File
- vendor/
symfony/ http-kernel/ Tests/ Fragment/ InlineFragmentRendererTest.php, line 52
Class
Namespace
Symfony\Component\HttpKernel\Tests\FragmentCode
public function testRenderWithObjectsAsAttributesPassedAsObjectsInTheController() {
$resolver = $this
->getMock('Symfony\\Component\\HttpKernel\\Controller\\ControllerResolver', array(
'getController',
));
$resolver
->expects($this
->once())
->method('getController')
->will($this
->returnValue(function (\stdClass $object, Bar $object1) {
return new Response($object1
->getBar());
}));
$kernel = new HttpKernel(new EventDispatcher(), $resolver);
$renderer = new InlineFragmentRenderer($kernel);
$response = $renderer
->render(new ControllerReference('main_controller', array(
'object' => new \stdClass(),
'object1' => new Bar(),
), array()), Request::create('/'));
$this
->assertEquals('bar', $response
->getContent());
}