mirror of
https://github.com/FriendsOfTYPO3/tea.git
synced 2024-10-19 14:16:12 +02:00
fddd50da3e
This makes the purpose of the mock/stub more explicit.
39 lines
1.1 KiB
PHP
39 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace TTN\Tea\Tests\Unit\Domain\Repository\Product;
|
|
|
|
use TTN\Tea\Domain\Repository\Product\TeaRepository;
|
|
use TYPO3\CMS\Extbase\Object\ObjectManagerInterface;
|
|
use TYPO3\CMS\Extbase\Persistence\Repository;
|
|
use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
|
|
|
|
/**
|
|
* @covers \TTN\Tea\Domain\Repository\Product\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);
|
|
}
|
|
}
|