2 declare(strict_types = 1);
18 use Psr\Http\Message\ServerRequestInterface;
22 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
34 $dataStructureIdentifier =
'{"type":"tca","tableName":"tt_content","fieldName":"pi_flexform","dataStructureKey":"blog_example,list"}';
35 $serverRequestProphecy = $this->prophesize(ServerRequestInterface::class);
36 $serverRequestProphecy->getParsedBody()->willReturn([
37 'value' =>
'theSearchValue',
42 'dataStructureIdentifier' => $dataStructureIdentifier,
43 'flexFormSheetName' =>
'sDb',
44 'flexFormFieldName' =>
'aField',
45 'flexFormContainerName' =>
'',
46 'flexFormContainerFieldName' =>
'',
57 'Sublevel field configuration',
66 $flexFormToolsProphecy = $this->prophesize(FlexFormTools::class);
67 GeneralUtility::addInstance(FlexFormTools::class, $flexFormToolsProphecy->reveal());
68 $flexFormToolsProphecy->parseDataStructureByIdentifier($dataStructureIdentifier)->willReturn($dataStructure);
70 $this->expectException(\RuntimeException::class);
71 $this->expectExceptionCode(1480609491);
80 $dataStructureIdentifier =
'{"type":"tca","tableName":"tt_content","fieldName":"pi_flexform","dataStructureKey":"blog_example,list"}';
81 $serverRequestProphecy = $this->prophesize(ServerRequestInterface::class);
82 $serverRequestProphecy->getParsedBody()->willReturn([
83 'value' =>
'theSearchValue',
88 'dataStructureIdentifier' => $dataStructureIdentifier,
89 'flexFormSheetName' =>
'sDb',
90 'flexFormFieldName' =>
'aField',
91 'flexFormContainerName' =>
'aContainer',
92 'flexFormContainerFieldName' =>
'aContainerFieldName',
100 'notTheFieldYouAreLookingFor' => [
103 'Sublevel field configuration',
112 $flexFormToolsProphecy = $this->prophesize(FlexFormTools::class);
113 GeneralUtility::addInstance(FlexFormTools::class, $flexFormToolsProphecy->reveal());
114 $flexFormToolsProphecy->parseDataStructureByIdentifier($dataStructureIdentifier)->willReturn($dataStructure);
116 $this->expectException(\RuntimeException::class);
117 $this->expectExceptionCode(1480611208);
129 $subject = $this->getAccessibleMock(SuggestWizardController::class, [
'dummy'], [],
'',
false);
130 $this->assertEquals($expected, $subject->_call(
'isTableHidden', $array));
139 'notSetValue' => [
false, [
'ctrl' => [
'hideTable' =>
null]]],
140 'true' => [
true, [
'ctrl' => [
'hideTable' =>
true]]],
141 'false' => [
false, [
'ctrl' => [
'hideTable' =>
false]]],
142 'string with true' => [
true, [
'ctrl' => [
'hideTable' =>
'1']]],
143 'string with false' => [
false, [
'ctrl' => [
'hideTable' =>
'0']]],