2 namespace TYPO3\CMS\Backend\Tests\Unit\Form\FormDataGroup;
17 use Prophecy\Argument;
18 use Prophecy\Prophecy\ObjectProphecy;
22 use TYPO3\CMS\Core\Tests\UnitTestCase;
44 $this->setExpectedException(\UnexpectedValueException::class, $this->anything(), 1441108674);
45 $this->subject->compile([]);
52 public function compileReturnsIncomingData()
55 $formDataProviderProphecy = $this->prophesize(FormDataProviderInterface::class);
57 $formDataProviderProphecy->addData(Argument::cetera())->willReturnArgument(0);
59 FormDataProviderInterface::class,
61 $this->subject->setProviderList($providerList);
67 $this->assertEquals($input, $this->subject->compile($input));
73 public function compileReturnsResultChangedByDataProvider()
76 $formDataProviderProphecy = $this->prophesize(FormDataProviderInterface::class);
80 FormDataProviderInterface::class,
82 $this->subject->setProviderList($providerList);
83 $providerResult = array(
'foo');
84 $formDataProviderProphecy->addData(Argument::cetera())->shouldBeCalled()->willReturn($providerResult);
86 $this->assertEquals($providerResult, $this->subject->compile([]));
92 public function compileThrowsExceptionIfDataProviderDoesNotImplementInterface()
95 $formDataProviderProphecy = $this->prophesize(\stdClass::class);
100 $this->subject->setProviderList($providerList);
102 $this->setExpectedException(\UnexpectedValueException::class, $this->anything(), 1441108719);
103 $this->subject->compile([]);