/**
  * Renders a partial.
  *
  * @param string $partialName
  * @param string $sectionName
  * @param array $variables
  * @param boolean $ignoreUnknown Ignore an unknown section and just return an empty string
  * @return string
  */
 public function renderPartial($partialName, $sectionName, array $variables, $ignoreUnknown = FALSE)
 {
     if (!isset($this->partialIdentifierCache[$partialName])) {
         $this->partialIdentifierCache[$partialName] = $this->templatePaths->getPartialIdentifier($partialName);
     }
     $partialIdentifier = $this->partialIdentifierCache[$partialName];
     $parsedPartial = $this->getOrParseAndStoreTemplate($partialIdentifier, function ($parent, TemplatePaths $paths) use($partialName) {
         return $paths->getPartialSource($partialName);
     });
     $variableContainer = new StandardVariableProvider($variables);
     $renderingContext = clone $this->getCurrentRenderingContext();
     $renderingContext->setVariableProvider($variableContainer);
     $this->startRendering(self::RENDERING_PARTIAL, $parsedPartial, $renderingContext);
     if ($sectionName !== NULL) {
         $output = $this->renderSection($sectionName, $variables, $ignoreUnknown);
     } else {
         $output = $parsedPartial->render($renderingContext);
     }
     $this->stopRendering();
     return $output;
 }
 /**
  * @test
  */
 public function testGetTemplateSourceThrowsExceptionIfFileNotFound()
 {
     $instance = new TemplatePaths();
     $this->setExpectedException('NamelessCoder\\Fluid\\View\\Exception\\InvalidTemplateResourceException');
     $instance->getTemplateSource();
 }