17 use Prophecy\Argument;
18 use Prophecy\Prophecy\ObjectProphecy;
23 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
35 protected function setUp()
46 $orderingServiceProphecy = $this->prophesize(DependencyOrderingService::class);
47 GeneralUtility::addInstance(DependencyOrderingService::class, $orderingServiceProphecy->reveal());
48 $orderingServiceProphecy->orderByDependencies(Argument::cetera())->willReturnArgument(0);
50 $GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'formEngine'][
'formDataGroup'][
'tcaSelectTreeAjaxFieldData'] = [];
54 $this->assertEquals($input, $this->subject->compile($input));
63 $orderingServiceProphecy = $this->prophesize(DependencyOrderingService::class);
64 GeneralUtility::addInstance(DependencyOrderingService::class, $orderingServiceProphecy->reveal());
65 $orderingServiceProphecy->orderByDependencies(Argument::cetera())->willReturnArgument(0);
68 $formDataProviderProphecy = $this->prophesize(FormDataProviderInterface::class);
69 $GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'formEngine'][
'formDataGroup'][
'tcaSelectTreeAjaxFieldData'] = [
70 FormDataProviderInterface::class => [],
72 GeneralUtility::addInstance(FormDataProviderInterface::class, $formDataProviderProphecy->reveal());
73 $providerResult = [
'foo'];
74 $formDataProviderProphecy->addData(Argument::cetera())->shouldBeCalled()->willReturn($providerResult);
76 $this->assertEquals($providerResult, $this->subject->compile([]));
85 $orderingServiceProphecy = $this->prophesize(DependencyOrderingService::class);
86 GeneralUtility::addInstance(DependencyOrderingService::class, $orderingServiceProphecy->reveal());
87 $orderingServiceProphecy->orderByDependencies(Argument::cetera())->willReturnArgument(0);
90 $formDataProviderProphecy = $this->prophesize(\stdClass::class);
91 $GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'formEngine'][
'formDataGroup'][
'tcaSelectTreeAjaxFieldData'] = [
92 \stdClass::class => [],
94 GeneralUtility::addInstance(\stdClass::class, $formDataProviderProphecy->reveal());
96 $this->expectException(\UnexpectedValueException::class);
97 $this->expectExceptionCode(1485299408);
99 $this->subject->compile([]);