From 3d92e0cc98741a5fddb40a657d0da2ac28fa11b1 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Wed, 1 Nov 2023 20:24:26 +0100 Subject: [PATCH] [CLEANUP] Use power of the DI container in the functional tests (#961) --- .../Domain/Repository/Product/TeaRepositoryTest.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Tests/Functional/Domain/Repository/Product/TeaRepositoryTest.php b/Tests/Functional/Domain/Repository/Product/TeaRepositoryTest.php index 5db48eb..5bf7976 100644 --- a/Tests/Functional/Domain/Repository/Product/TeaRepositoryTest.php +++ b/Tests/Functional/Domain/Repository/Product/TeaRepositoryTest.php @@ -6,9 +6,8 @@ namespace TTN\Tea\Tests\Functional\Domain\Repository\Product; use TTN\Tea\Domain\Model\Product\Tea; use TTN\Tea\Domain\Repository\Product\TeaRepository; -use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Domain\Model\FileReference; -use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager; +use TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; /** @@ -21,15 +20,15 @@ final class TeaRepositoryTest extends FunctionalTestCase private TeaRepository $subject; - private PersistenceManager $persistenceManager; + private PersistenceManagerInterface $persistenceManager; protected function setUp(): void { parent::setUp(); - $this->persistenceManager = GeneralUtility::makeInstance(PersistenceManager::class); + $this->persistenceManager = $this->get(PersistenceManagerInterface::class); - $this->subject = $this->getContainer()->get(TeaRepository::class); + $this->subject = $this->get(TeaRepository::class); } /**