2 declare(strict_types = 1);
19 use Prophecy\Argument;
20 use Prophecy\Prophecy\ObjectProphecy;
25 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
37 protected function setUp(): void
48 $orderingServiceProphecy = $this->prophesize(DependencyOrderingService::class);
49 GeneralUtility::addInstance(DependencyOrderingService::class, $orderingServiceProphecy->reveal());
50 $orderingServiceProphecy->orderByDependencies(Argument::cetera())->willReturnArgument(0);
52 $GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'formEngine'][
'formDataGroup'][
'siteConfiguration'] = [];
56 $this->assertEquals($input, $this->subject->compile($input));
65 $orderingServiceProphecy = $this->prophesize(DependencyOrderingService::class);
66 GeneralUtility::addInstance(DependencyOrderingService::class, $orderingServiceProphecy->reveal());
67 $orderingServiceProphecy->orderByDependencies(Argument::cetera())->willReturnArgument(0);
70 $formDataProviderProphecy = $this->prophesize(FormDataProviderInterface::class);
71 $GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'formEngine'][
'formDataGroup'][
'siteConfiguration'] = [
72 FormDataProviderInterface::class => [],
74 GeneralUtility::addInstance(FormDataProviderInterface::class, $formDataProviderProphecy->reveal());
75 $providerResult = [
'foo'];
76 $formDataProviderProphecy->addData(Argument::cetera())->shouldBeCalled()->willReturn($providerResult);
78 $this->assertEquals($providerResult, $this->subject->compile([]));
87 $orderingServiceProphecy = $this->prophesize(DependencyOrderingService::class);
88 GeneralUtility::addInstance(DependencyOrderingService::class, $orderingServiceProphecy->reveal());
89 $orderingServiceProphecy->orderByDependencies(Argument::cetera())->willReturnArgument(0);
92 $formDataProviderProphecy = $this->prophesize(\stdClass::class);
93 $GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'formEngine'][
'formDataGroup'][
'siteConfiguration'] = [
94 \stdClass::class => [],
96 GeneralUtility::addInstance(\stdClass::class, $formDataProviderProphecy->reveal());
98 $this->expectException(\UnexpectedValueException::class);
99 $this->expectExceptionCode(1485299408);
101 $this->subject->compile([]);