2 namespace TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider;
18 use Prophecy\Prophecy\ObjectProphecy;
20 use TYPO3\CMS\Core\Tests\UnitTestCase;
59 $this->assertSame($expected, $this->subject->addData($input));
73 'internal_type' =>
'foo',
79 $this->setExpectedException(\UnexpectedValueException::class, $this->anything(), 1438780511);
80 $this->subject->addData($input);
90 'aField' =>
'/aDir/aFile.txt,/anotherDir/anotherFile.css',
97 'internal_type' =>
'file',
104 $expected[
'databaseRow'][
'aField'] =
'%2FaDir%2FaFile.txt|aFile.txt,%2FanotherDir%2FanotherFile.css|anotherFile.css';
105 $this->assertSame($expected, $this->subject->addData($input));
111 public function addDataSetsDatabaseData()
115 'internal_type' =>
'db',
116 'MM' =>
'mmTableName',
117 'allowed' =>
'aForeignTable',
120 'tableName' =>
'aTable',
128 'config' => $aFieldConfig,
135 $relationHandlerProphecy = $this->prophesize(RelationHandler::class);
137 $relationHandlerProphecy->start(
'1,2',
'aForeignTable',
'mmTableName', 42,
'aTable', $aFieldConfig)->shouldBeCalled();
138 $relationHandlerProphecy->getFromDB()->shouldBeCalled();
139 $relationHandlerProphecy->readyForInterface()->shouldBeCalled()->willReturn(
'1|aLabel,2|anotherLabel');
142 $expected[
'databaseRow'][
'aField'] =
'1|aLabel,2|anotherLabel';
144 $this->assertSame($expected, $this->subject->addData($input));