2 declare(strict_types = 1);
18 use Prophecy\Argument;
19 use Prophecy\Prophecy\ObjectProphecy;
24 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
37 $orderingServiceProphecy = $this->prophesize(DependencyOrderingService::class);
38 GeneralUtility::addInstance(DependencyOrderingService::class, $orderingServiceProphecy->reveal());
39 $orderingServiceProphecy->orderByDependencies(Argument::cetera())->willReturnArgument(0);
44 $subject->setProviderList([]);
45 $this->assertEquals($input, $subject->compile($input));
54 $orderingServiceProphecy = $this->prophesize(DependencyOrderingService::class);
55 GeneralUtility::addInstance(DependencyOrderingService::class, $orderingServiceProphecy->reveal());
56 $orderingServiceProphecy->orderByDependencies(Argument::cetera())->willReturnArgument(0);
59 $formDataProviderProphecy = $this->prophesize(FormDataProviderInterface::class);
60 GeneralUtility::addInstance(FormDataProviderInterface::class, $formDataProviderProphecy->reveal());
61 $providerResult = [
'foo'];
62 $formDataProviderProphecy->addData(Argument::cetera())->shouldBeCalled()->willReturn($providerResult);
65 $subject->setProviderList([
66 FormDataProviderInterface::class => [],
68 $this->assertEquals($providerResult, $subject->compile([]));
77 $orderingServiceProphecy = $this->prophesize(DependencyOrderingService::class);
78 GeneralUtility::addInstance(DependencyOrderingService::class, $orderingServiceProphecy->reveal());
79 $orderingServiceProphecy->orderByDependencies(Argument::cetera())->willReturnArgument(0);
82 $subject->setProviderList([
83 FormDataProviderInterface::class => [
88 $this->assertEquals($input, $subject->compile($input));
97 $orderingServiceProphecy = $this->prophesize(DependencyOrderingService::class);
98 GeneralUtility::addInstance(DependencyOrderingService::class, $orderingServiceProphecy->reveal());
99 $orderingServiceProphecy->orderByDependencies(Argument::cetera())->willReturnArgument(0);
102 $formDataProviderProphecy = $this->prophesize(\stdClass::class);
103 GeneralUtility::addInstance(\stdClass::class, $formDataProviderProphecy->reveal());
105 $this->expectException(\UnexpectedValueException::class);
106 $this->expectExceptionCode(1485299408);
109 $subject->setProviderList([
110 \stdClass::class => [],
112 $subject->compile([]);