From 8fe9307b37fdfaa0518795b99a003b8e046bdb7f Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Thu, 22 Jun 2023 11:49:12 +0200 Subject: [PATCH] [BUGFIX] Allow `ActionController::redirect` in tests again (#865) In TYPO3 12LTS, this method still exists. So we are still able to mock it. --- Tests/Unit/Controller/TeaControllerTest.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Tests/Unit/Controller/TeaControllerTest.php b/Tests/Unit/Controller/TeaControllerTest.php index a60bb8b..b6c59d8 100644 --- a/Tests/Unit/Controller/TeaControllerTest.php +++ b/Tests/Unit/Controller/TeaControllerTest.php @@ -41,14 +41,11 @@ final class TeaControllerTest extends UnitTestCase parent::setUp(); // We need to create an accessible mock in order to be able to set the protected `view`. - $methodsToMock = ['redirectToUri', 'htmlResponse']; + $methodsToMock = ['htmlResponse', 'redirect', 'redirectToUri']; if ((new Typo3Version())->getMajorVersion() <= 11) { - $methodsToMock = array_merge($methodsToMock, ['forward', 'redirect']); + $methodsToMock[] = 'forward'; } - $this->subject = $this->getAccessibleMock( - TeaController::class, - $methodsToMock - ); + $this->subject = $this->getAccessibleMock(TeaController::class, $methodsToMock); $this->viewMock = $this->createMock(TemplateView::class); $this->subject->_set('view', $this->viewMock);