/** * Tests whether the item matches the given types. * * @param string $variable * @return boolean */ protected function validateVariable($variable) { $object = new GetVariable(new \SimpleXMLElement('<variable variable="' . $variable . '"/>')); if ($object->render('') !== '') { return true; } return false; }
/** * @covers Geissler\CSL\Rendering\Variable::__construct * @covers Geissler\CSL\Rendering\Variable::render * @covers Geissler\CSL\Rendering\Variable::hasAccessEmptyVariable */ public function testRenderNot() { $json = '[ { "title": "My long Book", "edition": "5", "id": "ITEM-1", "type": "book" }]'; $layout = '<text variable="URL" form="short"/>'; $this->initElement($layout, $json); $this->assertEquals('', $this->object->render('')); $this->assertTrue($this->object->hasAccessEmptyVariable()); }