public function testNewRendererWithResolvers()
 {
     $templatePathStack1 = new Resolver\TemplatePathStack();
     $templatePathStack1->addPath(realpath('view'));
     $templatePathStack2 = new Resolver\TemplatePathStack();
     $templatePathStack2->addPath(realpath('view'));
     $resolvers1 = array($templatePathStack1);
     $resolvers2 = array($templatePathStack2);
     $class = new ReflectionClass('Lfj\\ZfRenderer\\Renderer');
     $property = $class->getProperty("resolvers");
     $property->setAccessible(true);
     $rendererResolvers1 = new Renderer(null, null, $resolvers1);
     $rendererResolvers2 = $rendererResolvers1->withResolvers($resolvers2);
     $resolversFromRendererResolvers1 = $property->getValue($rendererResolvers1);
     $resolversFromRendererResolvers2 = $property->getValue($rendererResolvers2);
     // all resolvers of $rendererResolvers1 must be the same as the ones in $resolvers1
     // but must be different from the ones in $resolvers2
     foreach ($resolversFromRendererResolvers1 as $i => $v) {
         $this->assertSame($resolvers1[$i], $v);
         $this->assertNotSame($resolvers2[$i], $v);
     }
     // all resolvers of $rendererResolvers2 must be the same as the ones in $resolvers2
     // but must be different from the ones in $resolvers1
     foreach ($resolversFromRendererResolvers2 as $i => $v) {
         $this->assertSame($resolvers2[$i], $v);
         $this->assertNotSame($resolvers1[$i], $v);
     }
 }
 public function testRenderingAnotherTemplateInsideATemplate()
 {
     $expectedContent = 'hello world';
     $content = null;
     $template = realpath('view/template-with-renderer.phtml');
     $templatePathStack = new Resolver\TemplatePathStack();
     $templatePathStack->addPath(realpath('view'));
     $renderer = new Renderer();
     $rendererWithTemplatePathStack = $renderer->withResolvers(array($templatePathStack));
     $viewVariables = array('name' => 'world', 'renderer' => $rendererWithTemplatePathStack);
     $renderedContent = $rendererWithTemplatePathStack->render($template, $viewVariables);
     $this->assertEquals('Zend\\Stdlib\\Response', get_class($renderedContent->getResponse()));
     $this->assertEquals($expectedContent, $renderedContent->getResponse()->getContent());
 }