From 3a65496e31bbee0235f372bb4d478e567479ad58 Mon Sep 17 00:00:00 2001
From: Anja Leichsenring <aleichsenring@ab-softlab.de>
Date: Sat, 4 Apr 2020 10:45:38 +0200
Subject: [PATCH] [TASK] Remove warning from BackendLayout UnitTest after
 method removal

During refactoring of the class a method was removed, that was still
mentioned in a mock creation. This raised a warning in unit test runs.
Removing the mentioning (and the mock alongside with it) returns
the tests to green.

Resolves: #90943
Related: #90348
Related: #90839
Releases: master
Change-Id: I558d0bcd31942aac6241c819c8bf011dba23fe2c
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64067
Reviewed-by: Claus Due <claus@phpmind.net>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Guido Schmechel <guido.schmechel@brandung.de>
Reviewed-by: Alexander Schnitzler <git@alexanderschnitzler.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Alexander Schnitzler <git@alexanderschnitzler.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
---
 .../Tests/Unit/View/BackendLayout/BackendLayoutTest.php  | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/typo3/sysext/backend/Tests/Unit/View/BackendLayout/BackendLayoutTest.php b/typo3/sysext/backend/Tests/Unit/View/BackendLayout/BackendLayoutTest.php
index 2cab9d5ec1cd..080d46937ee1 100644
--- a/typo3/sysext/backend/Tests/Unit/View/BackendLayout/BackendLayoutTest.php
+++ b/typo3/sysext/backend/Tests/Unit/View/BackendLayout/BackendLayoutTest.php
@@ -14,7 +14,10 @@ namespace TYPO3\CMS\Backend\Tests\Unit\View\BackendLayout;
  * The TYPO3 project - inspiring people to share!
  */
 
+use Prophecy\Argument;
 use TYPO3\CMS\Backend\View\BackendLayout\BackendLayout;
+use TYPO3\CMS\Backend\View\BackendLayoutView;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\StringUtility;
 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
 
@@ -43,10 +46,14 @@ class BackendLayoutTest extends UnitTestCase
      */
     public function objectIsCreated()
     {
+        $backendLayoutView = $this->prophesize(BackendLayoutView::class);
+        $backendLayoutView->parseStructure(Argument::any())->willReturn([]);
+        GeneralUtility::setSingletonInstance(BackendLayoutView::class, $backendLayoutView->reveal());
+
         $identifier = StringUtility::getUniqueId('identifier');
         $title = StringUtility::getUniqueId('title');
         $configuration = StringUtility::getUniqueId('configuration');
-        $backendLayout = $this->getMockBuilder(BackendLayout::class)->onlyMethods(['parseConfigurationStringAndSetConfigurationArray'])->setConstructorArgs([$identifier, $title, $configuration])->getMock();
+        $backendLayout = new BackendLayout($identifier, $title, $configuration);
 
         self::assertEquals($identifier, $backendLayout->getIdentifier());
         self::assertEquals($title, $backendLayout->getTitle());
-- 
GitLab