diff --git a/typo3/sysext/backend/Classes/Form/Wizard/SuggestWizard.php b/typo3/sysext/backend/Classes/Form/Wizard/SuggestWizard.php index 2003273d1e16438fdc28c3209f8cac1acb55e924..832ffb5a1246b838e30206275b6852f7d95755a6 100644 --- a/typo3/sysext/backend/Classes/Form/Wizard/SuggestWizard.php +++ b/typo3/sysext/backend/Classes/Form/Wizard/SuggestWizard.php @@ -209,7 +209,7 @@ class SuggestWizard */ protected function isTableHidden(array $tableConfig) { - return !$tableConfig['ctrl']['hideTable']; + return (bool)$tableConfig['ctrl']['hideTable']; } /** diff --git a/typo3/sysext/backend/Tests/Unit/Form/Wizard/SuggestWizardTest.php b/typo3/sysext/backend/Tests/Unit/Form/Wizard/SuggestWizardTest.php index 83d6815572da0d7bff980f88cea8181f93dc36f6..574b2cfd70cc288040cf8b4096c304692dd4155e 100644 --- a/typo3/sysext/backend/Tests/Unit/Form/Wizard/SuggestWizardTest.php +++ b/typo3/sysext/backend/Tests/Unit/Form/Wizard/SuggestWizardTest.php @@ -148,4 +148,23 @@ class SuggestWizardTest extends UnitTestCase $subject->_call('getFieldConfiguration', $parts, $dataStructure); } + + /** + * @test + * @dataProvider isTableHiddenIsProperlyRetrievedDataProvider + */ + public function isTableHiddenIsProperlyRetrieved($expected, $array) { + $subject = $this->getAccessibleMock(SuggestWizard::class, array('dummy'), array(), '', false); + $this->assertEquals($expected, $subject->_call('isTableHidden', $array)); + } + + public function isTableHiddenIsProperlyRetrievedDataProvider() { + return [ + 'notSetValue' => [false, array('ctrl' => array('hideTable' => null))], + 'true' => [true, array('ctrl' => array('hideTable' => true))], + 'false' => [false, array('ctrl' => array('hideTable' => false))], + 'string with true' => [true, array('ctrl' => array('hideTable' => '1'))], + 'string with false' => [false, array('ctrl' => array('hideTable' => '0'))], + ]; + } }