[BUGFIX] adminpanel: Do not use getTSConfig in a deprecated way 96/58396/2
authorBenjamin Franzke <bfr@qbus.de>
Wed, 26 Sep 2018 06:35:20 +0000 (08:35 +0200)
committerGeorg Ringer <georg.ringer@gmail.com>
Wed, 26 Sep 2018 11:16:25 +0000 (13:16 +0200)
Since https://review.typo3.org/56968 handing over arguments
to getTSConfig() is deprecated.

As a drive-by we also fix some related wrong getTSConfig() mocks
in Unit/Middleware/AdminPanelInitiatorTest.php – they do not
produce errors, but these mocks are too unspecific, as they
still allow an argument to be passed.

Releases: master
Resolves: #86383
Related: #85016
Change-Id: I7254b5d0b87bc66da319728f7fe82aaa614b6a43
Reviewed-on: https://review.typo3.org/58396
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/adminpanel/Classes/Service/ConfigurationService.php
typo3/sysext/adminpanel/Tests/Unit/Middleware/AdminPanelInitiatorTest.php
typo3/sysext/adminpanel/Tests/Unit/Service/ConfigurationServiceTest.php

index ef724e4..294fcca 100644 (file)
@@ -38,7 +38,7 @@ class ConfigurationService implements SingletonInterface
 
     public function __construct()
     {
-        $this->mainConfiguration = $this->getBackendUser()->getTSConfig('admPanel')['properties'];
+        $this->mainConfiguration = $this->getBackendUser()->getTSConfig()['admPanel.'] ?? [];
     }
 
     /**
index d76ef5e..2b1f1dd 100644 (file)
@@ -55,7 +55,7 @@ class AdminPanelInitiatorTest extends UnitTestCase
             ]
         ];
         $userAuthentication = $this->prophesize(FrontendBackendUserAuthentication::class);
-        $userAuthentication->getTSConfig(Argument::any())->willReturn($tsConfig);
+        $userAuthentication->getTSConfig()->willReturn($tsConfig);
         $userAuthentication->uc = $uc;
         $GLOBALS['BE_USER'] = $userAuthentication->reveal();
 
@@ -121,7 +121,7 @@ class AdminPanelInitiatorTest extends UnitTestCase
     protected function checkAdminPanelDoesNotCallInitialize($tsConfig, $uc): void
     {
         $userAuthentication = $this->prophesize(FrontendBackendUserAuthentication::class);
-        $userAuthentication->getTSConfig(Argument::any())->willReturn($tsConfig);
+        $userAuthentication->getTSConfig()->willReturn($tsConfig);
         $userAuthentication->uc = $uc;
         $GLOBALS['BE_USER'] = $userAuthentication->reveal();
 
index 739b661..9825d04 100644 (file)
@@ -211,8 +211,8 @@ class ConfigurationServiceTest extends UnitTestCase
      */
     private function setUpUserTsConfigForAdmPanel($userTsAdmPanelConfig): void
     {
-        $this->beUserProphecy->getTSConfig('admPanel')->willReturn(
-            ['properties' => $userTsAdmPanelConfig]
+        $this->beUserProphecy->getTSConfig()->willReturn(
+            ['admPanel.' => $userTsAdmPanelConfig]
         );
     }
 }