/** * @test */ public function renderCanRenderMultipleComplexObjects() { $array = array('foo' => array('bar' => 'Baz')); $object = new \stdClass(); $object->foo = 'Foo'; $this->view->assign('array', $array)->assign('object', $object)->assign('someOtherVariable', 'Value3'); $this->view->setVariablesToRender(array('array', 'object')); $expectedResult = '{"array":{"foo":{"bar":"Baz"}},"object":{"foo":"Foo"}}'; $actualResult = $this->view->render(); $this->assertEquals($expectedResult, $actualResult); }
/** * Action List * * @return void */ public function listAction() { $this->view->setVariablesToRender([$this->resourceArgumentName . 's']); $this->view->assign($this->resourceArgumentName . 's', $this->resourceRepository->findAll()); }