Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Richter committed Sep 19, 2024
1 parent 38e7062 commit 1ced849
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Tests/Unit/Controller/BibliographyControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -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
Expand All @@ -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);
}
Expand Down

0 comments on commit 1ced849

Please sign in to comment.