mirror of
https://github.com/FriendsOfTYPO3/tea.git
synced 2024-11-27 03:16:14 +01:00
eeda862e77
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
39 lines
1 KiB
PHP
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);
|
|
}
|
|
}
|