Beispiel #1
0
 /**
  * @test
  */
 public function templateVariableContainerCanBeReadCorrectly()
 {
     $templateVariableContainer = $this->getMock(StandardVariableProvider::class);
     $this->renderingContext->setVariableProvider($templateVariableContainer);
     $this->assertSame($this->renderingContext->getVariableProvider(), $templateVariableContainer, 'Template Variable Container could not be read out again.');
 }
 /**
  * @test
  */
 public function templateVariableContainerCanBeReadCorrectly()
 {
     $templateVariableContainer = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\TemplateVariableContainer::class);
     $this->renderingContext->setVariableProvider($templateVariableContainer);
     $this->assertSame($this->renderingContext->getTemplateVariableContainer(), $templateVariableContainer, 'Template Variable Container could not be read out again.');
 }
Beispiel #3
0
 /**
  * Overlay variables by replacing the VariableProvider with a
  * ChainedVariableProvider using dual data sources. Returns the
  * original VariableProvider which must replace the temporary
  * one again once the rendering/compiling is done.
  *
  * @param RenderingContextInterface $renderingContext
  * @param array $variables
  * @return VariableProviderInterface
  */
 protected static function overlayVariablesIfNotSet(RenderingContextInterface $renderingContext, array $variables)
 {
     $currentProvider = $renderingContext->getVariableProvider();
     $chainedVariableProvider = new ChainedVariableProvider([$currentProvider, new StandardVariableProvider($variables)]);
     $renderingContext->setVariableProvider($chainedVariableProvider);
     return $currentProvider;
 }