22 use TYPO3\TestingFramework\Fluid\Unit\ViewHelpers\ViewHelperBaseTestcase;
23 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
40 protected function setUp()
43 $this->context = GeneralUtility::makeInstance(Context::class);
45 $this->injectDependenciesIntoViewHelper($this->viewHelper);
46 $this->viewHelper->initializeArguments();
51 GeneralUtility::removeSingletonInstance(Context::class, $this->context);
59 $user =
new FrontendUserAuthentication();
60 $user->user[
'uid'] = 13;
61 $this->context->setAspect(
'frontend.user',
new UserAspect($user));
63 $actualResult = $this->viewHelper->renderStatic(
64 [
'then' =>
'then child',
'else' =>
'else child'],
67 $this->prophesize(RenderingContextInterface::class)->reveal()
70 $this->assertEquals(
'then child', $actualResult);
78 $this->context->setAspect(
'frontend.user',
new UserAspect());
80 $actualResult = $this->viewHelper->renderStatic(
81 [
'then' =>
'then child',
'else' =>
'else child'],
84 $this->prophesize(RenderingContextInterface::class)->reveal()
87 $this->assertEquals(
'else child', $actualResult);