Skip to content

Commit

Permalink
[CLEANUP] Use power of the DI container in the functional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverklee committed Nov 1, 2023
1 parent edbb534 commit b4741ef
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@

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;

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

/**
Expand Down

0 comments on commit b4741ef

Please sign in to comment.