2 namespace TYPO3\CMS\Backend\Tests\Unit\Form\FormDataGroup;
17 use Prophecy\Argument;
18 use Prophecy\Prophecy\ObjectProphecy;
23 use TYPO3\CMS\Core\Tests\UnitTestCase;
43 public function compileReturnsIncomingData()
46 $orderingServiceProphecy = $this->prophesize(DependencyOrderingService::class);
48 $orderingServiceProphecy->orderByDependencies(Argument::cetera())->willReturnArgument(0);
50 $GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'formEngine'][
'formDataGroup'][
'inlineParentRecord'] = array();
52 $input = array(
'foo');
54 $this->assertEquals($input, $this->subject->compile($input));
60 public function compileReturnsResultChangedByDataProvider()
63 $orderingServiceProphecy = $this->prophesize(DependencyOrderingService::class);
65 $orderingServiceProphecy->orderByDependencies(Argument::cetera())->willReturnArgument(0);
68 $formDataProviderProphecy = $this->prophesize(FormDataProviderInterface::class);
69 $GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'formEngine'][
'formDataGroup'][
'inlineParentRecord'] = array(
70 FormDataProviderInterface::class => array(),
73 $providerResult = array(
'foo');
74 $formDataProviderProphecy->addData(Argument::cetera())->shouldBeCalled()->willReturn($providerResult);
76 $this->assertEquals($providerResult, $this->subject->compile([]));
82 public function compileThrowsExceptionIfDataProviderDoesNotImplementInterface()
85 $orderingServiceProphecy = $this->prophesize(DependencyOrderingService::class);
87 $orderingServiceProphecy->orderByDependencies(Argument::cetera())->willReturnArgument(0);
90 $formDataProviderProphecy = $this->prophesize(\stdClass::class);
91 $GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'formEngine'][
'formDataGroup'][
'inlineParentRecord'] = array(
92 \stdClass::class => array(),
96 $this->setExpectedException(\UnexpectedValueException::class, $this->anything(), 1444398947);
98 $this->subject->compile([]);