forked from FluidTYPO3/vhs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Add a test case for UncacheContentObject
- Loading branch information
1 parent
71db290
commit db54b37
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
namespace FluidTYPO3\Vhs\Tests\Unit\View; | ||
|
||
/* | ||
* This file is part of the FluidTYPO3/Vhs project under GPLv2 or later. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.md file that was distributed with this source code. | ||
*/ | ||
|
||
use FluidTYPO3\Vhs\Tests\Unit\AbstractTestCase; | ||
use FluidTYPO3\Vhs\View\UncacheContentObject; | ||
use FluidTYPO3\Vhs\View\UncacheTemplateView; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer; | ||
|
||
class UncacheContentObjectTest extends AbstractTestCase | ||
{ | ||
public function testDelegatesToUncacheTemplateView(): void | ||
{ | ||
$uncacheTemplateView = $this->getMockBuilder(UncacheTemplateView::class) | ||
->setMethods(['callUserFunction']) | ||
->disableOriginalConstructor() | ||
->getMock(); | ||
$uncacheTemplateView->method('callUserFunction')->willReturn('rendered'); | ||
GeneralUtility::addInstance(UncacheTemplateView::class, $uncacheTemplateView); | ||
|
||
$subject = new UncacheContentObject( | ||
$this->getMockBuilder(ContentObjectRenderer::class)->disableOriginalConstructor()->getMock() | ||
); | ||
self::assertSame('rendered', $subject->render([])); | ||
} | ||
} |