2018-05-25 16:19:12 +02:00
|
|
|
<?php
|
2019-12-07 12:13:32 +01:00
|
|
|
|
2019-08-12 17:25:59 +02:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2024-01-16 15:21:21 +01:00
|
|
|
namespace TTN\Tea\Tests\Unit\Domain\Repository;
|
2018-05-25 16:19:12 +02:00
|
|
|
|
2024-01-16 15:21:21 +01:00
|
|
|
use TTN\Tea\Domain\Repository\TeaRepository;
|
2018-05-25 16:19:12 +02:00
|
|
|
use TYPO3\CMS\Extbase\Object\ObjectManagerInterface;
|
|
|
|
use TYPO3\CMS\Extbase\Persistence\Repository;
|
2022-02-20 15:18:46 +01:00
|
|
|
use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
|
2018-05-25 16:19:12 +02:00
|
|
|
|
|
|
|
/**
|
2024-01-16 15:21:21 +01:00
|
|
|
* @covers \TTN\Tea\Domain\Repository\TeaRepository
|
2018-05-25 16:19:12 +02:00
|
|
|
*/
|
2023-04-06 16:34:15 +02:00
|
|
|
final class TeaRepositoryTest extends UnitTestCase
|
2018-05-25 16:19:12 +02:00
|
|
|
{
|
2022-10-03 19:00:55 +02:00
|
|
|
private TeaRepository $subject;
|
2018-05-25 16:19:12 +02:00
|
|
|
|
2019-08-12 17:25:59 +02:00
|
|
|
protected function setUp(): void
|
2018-05-25 16:19:12 +02:00
|
|
|
{
|
2022-02-20 15:18:46 +01:00
|
|
|
parent::setUp();
|
|
|
|
|
2022-10-10 02:15:33 +02:00
|
|
|
if (\interface_exists(ObjectManagerInterface::class)) {
|
2023-11-05 22:46:37 +01:00
|
|
|
$objectManagerStub = $this->createStub(ObjectManagerInterface::class);
|
2022-10-19 09:06:36 +02:00
|
|
|
// @phpstan-ignore-next-line This line is 11LTS-specific, but we're running PHPStan on TYPO3 12.
|
2023-11-05 22:46:37 +01:00
|
|
|
$this->subject = new TeaRepository($objectManagerStub);
|
2022-10-10 02:15:33 +02:00
|
|
|
} else {
|
|
|
|
$this->subject = new TeaRepository();
|
|
|
|
}
|
2018-05-25 16:19:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
*/
|
2019-08-12 17:25:59 +02:00
|
|
|
public function isRepository(): void
|
2018-05-25 16:19:12 +02:00
|
|
|
{
|
2019-08-12 17:25:59 +02:00
|
|
|
self::assertInstanceOf(Repository::class, $this->subject);
|
2018-05-25 16:19:12 +02:00
|
|
|
}
|
|
|
|
}
|