public function render($format = 'json')
{
$class_name = '\\FOF30\\Hal\\Render\\' . ucfirst($format);
if (!class_exists($class_name, true)) {
throw new InvalidRenderFormat($format);
}
/** @var RenderInterface $renderer */
$renderer = new $class_name($this);
return $renderer->render(array('data_key' => $this->_dataKey));
}
/** * @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__ . '.'); }