public function pushContext($key, $context) { $newContext = $this->getCurrentContext(); $newContext[$key] = $context; $this->renderingStack[] = $newContext; }
/** * @test */ public function viewHelperRendersUriViaStringPointingToSubNodes() { $this->tsRuntime->pushContext('documentNode', $this->contentContext->getCurrentSiteNode()->getNode('home/about-us/mission')); $this->assertSame('<a href="/en/home/about-us/history.html">History</a>', $this->viewHelper->render('../history')); $this->tsRuntime->popContext(); $this->assertSame('<a href="/en/home/about-us/our-mission.html">Our mission</a>', $this->viewHelper->render('about-us/mission')); $this->assertSame('<a href="/en/home/about-us/our-mission.html">Our mission</a>', $this->viewHelper->render('./about-us/mission')); }