/** * getParent * * @return mixed|null */ public function parent() { if (!$this->extend) { return null; } if (!$this->parent) { $this->parent = new static($this->paths); $this->parent->render($this->extend, $this->data); } return $this->parent->getBlock($this->currentBlock); }
/** * testLoadWithData * * @return void */ public function testLoadWithData() { $data = array('class' => 'flower', 'title' => 'Sakura', 'content' => 'Nulla sollicitudin vel augue quis aliquet.'); $html = $this->instance->render('data1', $data); $expect = <<<HTML <div id="data" class="flower"> \t<h1>Sakura</h1> \t<p>Morbi suscipit ante massa</p> </div> HTML; $this->assertDomStringEqualsDomString($expect, $html); }
public function testRenderLocalVariables() { $data = array('class' => 'flower', 'title' => 'Sakura', 'content' => 'Nulla sollicitudin vel augue quis aliquet.'); $this->instance->config->set('local_variables', true); $html = $this->instance->render('data1_local', $data); $expect = <<<HTML <div id="data" class="flower"> \t<h1>Sakura</h1> \t<p>Morbi suscipit ante massa</p> </div> HTML; $this->assertDomStringEqualsDomString($expect, $html); }