render() public method

Instantiate and call a suitable renderer class to render this document into the specified format.
public render ( string $format = 'json' ) : string
$format string The format to render the document into, e.g. 'json'
return string The rendered document
コード例 #1
0
ファイル: DocumentTest.php プロジェクト: Joal01/fof
 /**
  * @covers FOF30\Hal\Document::render
  */
 public function testRender_success()
 {
     $data = array('test1' => 'one', 'test2' => 'two', 'testArray' => array('testUno' => 'uno', 'testDue' => 'Due'));
     $document = new Document($data);
     $data = $document->render('json');
     $this->assertInternalType('string', $data, 'Line: ' . __LINE__ . '.');
 }