mirror of
https://github.com/FriendsOfTYPO3/tea.git
synced 2024-11-22 13:36:13 +01:00
[BUGFIX] Do not mock unavailable methods (#799)
This commit is contained in:
parent
f1b4faa9eb
commit
4d2bbced74
1 changed files with 6 additions and 1 deletions
|
@ -9,6 +9,7 @@ use TTN\Tea\Controller\TeaController;
|
||||||
use TTN\Tea\Domain\Model\Product\Tea;
|
use TTN\Tea\Domain\Model\Product\Tea;
|
||||||
use TTN\Tea\Domain\Repository\Product\TeaRepository;
|
use TTN\Tea\Domain\Repository\Product\TeaRepository;
|
||||||
use TYPO3\CMS\Core\Http\HtmlResponse;
|
use TYPO3\CMS\Core\Http\HtmlResponse;
|
||||||
|
use TYPO3\CMS\Core\Information\Typo3Version;
|
||||||
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
|
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
|
||||||
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
|
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
|
||||||
use TYPO3\CMS\Fluid\View\TemplateView;
|
use TYPO3\CMS\Fluid\View\TemplateView;
|
||||||
|
@ -40,9 +41,13 @@ class TeaControllerTest extends UnitTestCase
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
// We need to create an accessible mock in order to be able to set the protected `view`.
|
// We need to create an accessible mock in order to be able to set the protected `view`.
|
||||||
|
$methodsToMock = ['redirectToUri', 'htmlResponse'];
|
||||||
|
if ((new Typo3Version())->getMajorVersion() <= 11) {
|
||||||
|
$methodsToMock = array_merge($methodsToMock, ['forward', 'redirect']);
|
||||||
|
}
|
||||||
$this->subject = $this->getAccessibleMock(
|
$this->subject = $this->getAccessibleMock(
|
||||||
TeaController::class,
|
TeaController::class,
|
||||||
['forward', 'redirect', 'redirectToUri', 'htmlResponse']
|
$methodsToMock
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->viewMock = $this->createMock(TemplateView::class);
|
$this->viewMock = $this->createMock(TemplateView::class);
|
||||||
|
|
Loading…
Reference in a new issue