2 declare(strict_types = 1);
18 use Prophecy\Argument;
24 use TYPO3\TestingFramework\Fluid\Unit\ViewHelpers\ViewHelperBaseTestcase;
36 protected function setUp()
39 $this->viewHelper = $this->getAccessibleMock(IconViewHelper::class, [
'renderChildren']);
40 $this->injectDependenciesIntoViewHelper($this->viewHelper);
41 $this->viewHelper->initializeArguments();
49 $iconFactoryProphecy = $this->prophesize(IconFactory::class);
50 GeneralUtility::addInstance(IconFactory::class, $iconFactoryProphecy->reveal());
51 $iconProphecy = $this->prophesize(Icon::class);
54 $iconProphecy->render(
null)->shouldBeCalled()->willReturn(
'htmlFoo');
56 $this->viewHelper->setArguments([
57 'identifier' =>
'myIdentifier',
61 'alternativeMarkupIdentifier' =>
null
64 $this->assertSame(
'htmlFoo', $this->viewHelper->render());
72 $iconFactoryProphecy = $this->prophesize(IconFactory::class);
73 GeneralUtility::addInstance(IconFactory::class, $iconFactoryProphecy->reveal());
74 $iconProphecy = $this->prophesize(Icon::class);
77 $iconProphecy->render(
null)->shouldBeCalled()->willReturn(
'htmlFoo');
79 $this->viewHelper->setArguments([
80 'identifier' =>
'myIdentifier',
84 'alternativeMarkupIdentifier' =>
null
87 $this->assertSame(
'htmlFoo', $this->viewHelper->render());
95 $iconFactoryProphecy = $this->prophesize(IconFactory::class);
96 GeneralUtility::addInstance(IconFactory::class, $iconFactoryProphecy->reveal());
97 $iconProphecy = $this->prophesize(Icon::class);
100 $iconProphecy->render(
null)->shouldBeCalled()->willReturn(
'htmlFoo');
102 $this->viewHelper->setArguments([
103 'identifier' =>
'myIdentifier',
107 'alternativeMarkupIdentifier' =>
null
110 $this->assertSame(
'htmlFoo', $this->viewHelper->render());
118 $iconFactoryProphecy = $this->prophesize(IconFactory::class);
119 GeneralUtility::addInstance(IconFactory::class, $iconFactoryProphecy->reveal());
120 $iconProphecy = $this->prophesize(Icon::class);
123 $iconProphecy->render(
null)->shouldBeCalled()->willReturn(
'htmlFoo');
125 $this->viewHelper->setArguments([
126 'identifier' =>
'myIdentifier',
128 'overlay' =>
'overlayString',
130 'alternativeMarkupIdentifier' =>
null
132 $this->assertSame(
'htmlFoo', $this->viewHelper->render());