Ejemplo n.º 1
0
 /**
  * @test
  */
 public function pushAndGetFromStackWorks()
 {
     $rootNode = new 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.');
 }
Ejemplo n.º 2
0
 /**
  * @return ParsingState
  */
 protected function getParsingState()
 {
     $rootNode = new RootNode();
     $variableProvider = $this->renderingContext->getVariableProvider();
     $state = new ParsingState();
     $state->setRootNode($rootNode);
     $state->pushNodeToStack($rootNode);
     $state->setVariableProvider($variableProvider->getScopeCopy($variableProvider->getAll()));
     return $state;
 }
Ejemplo n.º 3
0
 /**
  * @return ParsingState
  */
 protected function getParsingState()
 {
     $rootNode = new RootNode();
     $state = new ParsingState();
     $state->setVariableProvider($this->variableProvider);
     $state->setViewHelperResolver($this->viewHelperResolver);
     $state->setRootNode($rootNode);
     $state->pushNodeToStack($rootNode);
     return $state;
 }