mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2024-11-10 06:36:13 +01:00
tea/Tests/Unit/Domain/Repository/TeaRepositoryTest.php
Oliver Klee eeda862e77
[!!!][TASK] Drop additional namespace segment for the Tea model (#1025)
The `Product` namespace segment in the domain model namespace
`TTN\Tea\Domain\Model` currently serves no purpose and only adds
confusion. So let's simplify the extension structure accordingly.

(I intended to use this to demonstrate DDD contexts, but never
built enough models in the Tea extension for this to actually
make sense.)

Fixes #1008
2024-01-16 15:21:21 +01:00

39 lines
1 KiB
PHP

<?php
declare(strict_types=1);
namespace TTN\Tea\Tests\Unit\Domain\Repository;
use TTN\Tea\Domain\Repository\TeaRepository;
use TYPO3\CMS\Extbase\Object\ObjectManagerInterface;
use TYPO3\CMS\Extbase\Persistence\Repository;
use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
/**
* @covers \TTN\Tea\Domain\Repository\TeaRepository
*/
final class TeaRepositoryTest extends UnitTestCase
{
private TeaRepository $subject;
protected function setUp(): void
{
parent::setUp();
if (\interface_exists(ObjectManagerInterface::class)) {
$objectManagerStub = $this->createStub(ObjectManagerInterface::class);
// @phpstan-ignore-next-line This line is 11LTS-specific, but we're running PHPStan on TYPO3 12.
$this->subject = new TeaRepository($objectManagerStub);
} else {
$this->subject = new TeaRepository();
}
}
/**
* @test
*/
public function isRepository(): void
{
self::assertInstanceOf(Repository::class, $this->subject);
}
}