From 1ced849f8d7e50b6f293115346cf308a18520f38 Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Thu, 19 Sep 2024 14:57:05 +0200 Subject: [PATCH] Fix test --- .../Unit/Controller/BibliographyControllerTest.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Tests/Unit/Controller/BibliographyControllerTest.php b/Tests/Unit/Controller/BibliographyControllerTest.php index fb1cbef..7e4e84a 100644 --- a/Tests/Unit/Controller/BibliographyControllerTest.php +++ b/Tests/Unit/Controller/BibliographyControllerTest.php @@ -5,10 +5,9 @@ use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; use Slub\LisztBibliography\Controller\BibliographyController; +use Slub\LisztBibliography\Services\ElasticSearchService; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Http\HtmlResponse; -use TYPO3\CMS\Core\Http\ResponseFactory; -use TYPO3\CMS\Core\Http\StreamFactory; use TYPO3\TestingFramework\Core\Unit\UnitTestCase; /** @@ -22,10 +21,9 @@ protected function setUp(): void { parent::setUp(); - $methodsToMock = ['indexAction']; - $responseFactory = GeneralUtility::makeInstance(ResponseFactory::class); - $streamFactory = GeneralUtility::makeInstance(StreamFactory::class); - $this->subject = $this->getAccessibleMock(BibliographyController::class, $methodsToMock, [$responseFactory, $streamFactory]); + $methodsToMock = ['searchAction']; + $elasticSearchService = GeneralUtility::makeInstance(ElasticSearchService::class); + $this->subject = $this->getAccessibleMock(BibliographyController::class, $methodsToMock, [$elasticSearchService]); } public function tearDown(): void @@ -36,9 +34,9 @@ public function tearDown(): void /** * @test */ - public function indexActionReturnsHtmlResponse(): void + public function searchActionReturnsHtmlResponse(): void { - $result = $this->subject->indexAction(); + $result = $this->subject->searchAction(); self::assertInstanceOf(ResponseInterface::class, $result); }