[FOLLOWUP][BUGFIX] Use compiled system language rows, fix tests 74/44374/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Thu, 29 Oct 2015 19:46:18 +0000 (20:46 +0100)
committerMorton Jonuschat <m.jonuschat@mojocode.de>
Thu, 29 Oct 2015 19:51:23 +0000 (20:51 +0100)
Resolves: #69816
Releases: master
Change-Id: I79cee0ee02efe4bdc22ac79d04d4a42d63bc85ed
Reviewed-on: https://review.typo3.org/44374
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseSystemLanguageRowsTest.php
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaSelectItemsTest.php

index aa1fd1f..dfa2c47 100644 (file)
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Backend\Form\FormDataProvider;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Backend\Configuration\TranslationConfigurationProvider;
 use TYPO3\CMS\Backend\Module\ModuleLoader;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
index 50e4160..d30f771 100644 (file)
@@ -179,7 +179,7 @@ class DatabaseSystemLanguageRowsTest extends UnitTestCase
                 'flag' => 'fr',
             ],
         ];
-        $this->dbProphecy->exec_SELECTgetRows('uid,title,language_isocode,static_lang_isocode,flag', 'sys_language', 'pid=0 AND hidden=0')->willReturn($dbRows);
+        $this->dbProphecy->exec_SELECTgetRows('uid,title,language_isocode,static_lang_isocode,flag', 'sys_language', 'pid=0')->willReturn($dbRows);
         $expected = [
             'systemLanguageRows' => [
                 -1 => [
@@ -222,7 +222,7 @@ class DatabaseSystemLanguageRowsTest extends UnitTestCase
                 'flag' => 'fr',
             ],
         ];
-        $this->dbProphecy->exec_SELECTgetRows('uid,title,language_isocode,static_lang_isocode,flag', 'sys_language', 'pid=0 AND hidden=0')->shouldBeCalled()->willReturn($dbRows);
+        $this->dbProphecy->exec_SELECTgetRows('uid,title,language_isocode,static_lang_isocode,flag', 'sys_language', 'pid=0')->shouldBeCalled()->willReturn($dbRows);
         // Needed for backendUtility::getRecord()
         $GLOBALS['TCA']['static_languages'] = [ 'foo' ];
         $this->dbProphecy->exec_SELECTgetSingleRow('lg_iso_2', 'static_languages', 'uid=42')->shouldBeCalled()->willReturn([ 'lg_iso_2' => 'FR' ]);
@@ -265,7 +265,7 @@ class DatabaseSystemLanguageRowsTest extends UnitTestCase
                 'flag' => 'fr',
             ],
         ];
-        $this->dbProphecy->exec_SELECTgetRows('uid,title,language_isocode,static_lang_isocode,flag', 'sys_language', 'pid=0 AND hidden=0')->shouldBeCalled()->willReturn($dbRows);
+        $this->dbProphecy->exec_SELECTgetRows('uid,title,language_isocode,static_lang_isocode,flag', 'sys_language', 'pid=0')->shouldBeCalled()->willReturn($dbRows);
         // Needed for backendUtility::getRecord()
         $GLOBALS['TCA']['static_languages'] = [ 'foo' ];
         $expected = [
index d340462..05a86b1 100644 (file)
@@ -936,6 +936,13 @@ class TcaSelectItemsTest extends UnitTestCase
                     ],
                 ],
             ],
+            'systemLanguageRows' => [
+                0 => [
+                    'title' => 'aLangTitle',
+                    'uid' => 42,
+                    'flagIconIdentifier' => 'aFlag.gif',
+                ],
+            ],
         ];
 
         /** @var LanguageService|ObjectProphecy $languageService */
@@ -943,18 +950,6 @@ class TcaSelectItemsTest extends UnitTestCase
         $GLOBALS['LANG'] = $languageService->reveal();
         $languageService->sL(Argument::cetera())->willReturnArgument(0);
 
-        $languages = [
-            0 => [
-                'title' => 'aLangTitle',
-                'uid' => 42,
-                'flagIcon' => 'aFlag.gif',
-            ],
-        ];
-
-        $translationProphecy = $this->prophesize(TranslationConfigurationProvider::class);
-        GeneralUtility::addInstance(TranslationConfigurationProvider::class, $translationProphecy->reveal());
-        $translationProphecy->getSystemLanguages()->shouldBeCalled()->willReturn($languages);
-
         $expectedItems = [
             0 => [
                 0 => 'aLangTitle [42]',