mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2024-12-22 18:46:11 +01:00

[CLEANUP] Use power of the DI container in the functional tests (#961)

This commit is contained in:
Oliver Klee 2023-11-01 20:24:26 +01:00 committed by GitHub
parent edbb5342bd
commit 3d92e0cc98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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