/**
  * @test
  * @author Sebastian Kurfürst <*****@*****.**>
  */
 public function pushAndGetFromStackWorks()
 {
     $rootNode = new Tx_Fluid_Core_Parser_SyntaxTree_RootNode();
     $this->parsingState->pushNodeToStack($rootNode);
     $this->assertSame($rootNode, $this->parsingState->getNodeFromStack($rootNode), 'Node returned from stack was not the right one.');
     $this->assertSame($rootNode, $this->parsingState->popNodeFromStack($rootNode), 'Node popped from stack was not the right one.');
 }
 /**
  * Handles a closing view helper tag
  *
  * @param Tx_Fluid_Core_Parser_ParsingState $state The current parsing state
  * @param string $namespaceIdentifier Namespace identifier for the closing tag.
  * @param string $methodIdentifier Method identifier.
  * @return void
  * @throws Tx_Fluid_Core_Parser_Exception
  * @author Sebastian Kurfürst <*****@*****.**>
  */
 protected function closingViewHelperTagHandler(Tx_Fluid_Core_Parser_ParsingState $state, $namespaceIdentifier, $methodIdentifier)
 {
     if (!array_key_exists($namespaceIdentifier, $this->namespaces)) {
         throw new Tx_Fluid_Core_Parser_Exception('Namespace could not be resolved. This exception should never be thrown!', 1224256186);
     }
     $lastStackElement = $state->popNodeFromStack();
     if (!$lastStackElement instanceof Tx_Fluid_Core_Parser_SyntaxTree_ViewHelperNode) {
         throw new Tx_Fluid_Core_Parser_Exception('You closed a templating tag which you never opened!', 1224485838);
     }
     if ($lastStackElement->getViewHelperClassName() != $this->resolveViewHelperName($namespaceIdentifier, $methodIdentifier)) {
         throw new Tx_Fluid_Core_Parser_Exception('Templating tags not properly nested. Expected: ' . $lastStackElement->getViewHelperClassName() . '; Actual: ' . $this->resolveViewHelperName($namespaceIdentifier, $methodIdentifier), 1224485398);
     }
     $this->callInterceptor($lastStackElement, Tx_Fluid_Core_Parser_InterceptorInterface::INTERCEPT_CLOSING_VIEWHELPER);
 }