コード例 #1
0
ファイル: JsonViewTest.php プロジェクト: Mr-Robota/TYPO3.CMS
 /**
  * @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);
 }
コード例 #2
0
 /**
  * Action List
  *
  * @return void
  */
 public function listAction()
 {
     $this->view->setVariablesToRender([$this->resourceArgumentName . 's']);
     $this->view->assign($this->resourceArgumentName . 's', $this->resourceRepository->findAll());
 }