mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2024-11-22 08:16:13 +01:00

[BUGFIX] Allow ActionController::redirect in tests again (#865)

In TYPO3 12LTS, this method still exists. So we are still able
to mock it.
This commit is contained in:
Oliver Klee 2023-06-22 11:49:12 +02:00 committed by GitHub
parent 0c53667a15
commit 8fe9307b37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);