Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit 2c89b46

Browse files
author
Kevin Porebski
committed
Test for ensuring, that the PhpRenderer doesnt use previous rendered output
1 parent 4d9954c commit 2c89b46

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

test/PhpRendererTest.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,4 +481,32 @@ public function testDoesNotCallFilterChainIfNoFilterChainWasSet()
481481
$this->assertContains('Empty view', $result);
482482
$this->assertAttributeEmpty('__filterChain', $this->renderer);
483483
}
484+
485+
/**
486+
* @group zend-view-120
487+
*/
488+
public function testRendererDoesntUsePreviousRenderedOutputWhenInvokedWithEmptyString()
489+
{
490+
$this->renderer->resolver()->addPath(__DIR__ . '/_templates');
491+
492+
$previousOutput = $this->renderer->render('empty.phtml');
493+
494+
$actual = $this->renderer->render('');
495+
496+
$this->assertNotSame($previousOutput, $actual);
497+
}
498+
499+
/**
500+
* @group zend-view-120
501+
*/
502+
public function testRendererDoesntUsePreviousRenderedOutputWhenInvokedWithFalse()
503+
{
504+
$this->renderer->resolver()->addPath(__DIR__ . '/_templates');
505+
506+
$previousOutput = $this->renderer->render('empty.phtml');
507+
508+
$actual = $this->renderer->render(false);
509+
510+
$this->assertNotSame($previousOutput, $actual);
511+
}
484512
}

0 commit comments

Comments
 (0)