Skip to content

Commit

Permalink
[TASK] Move the repository unit tests to functional
Browse files Browse the repository at this point in the history
This saves us the work of instantiating the repositories and their
dependencies ourselves in the tests.
  • Loading branch information
oliverklee committed Oct 3, 2024
1 parent e38fcd1 commit af7d53d
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 114 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
namespace OliverKlee\FeUserExtraFields\Tests\Functional\Domain\Repository;

use OliverKlee\FeUserExtraFields\Domain\Model\FrontendUserGroup;
use OliverKlee\FeUserExtraFields\Domain\Repository\DirectPersistInterface;
use OliverKlee\FeUserExtraFields\Domain\Repository\FrontendUserGroupRepository;
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
use TYPO3\CMS\Extbase\Persistence\Repository;
use TYPO3\CMS\Extbase\Persistence\RepositoryInterface;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;

/**
Expand All @@ -26,6 +29,30 @@ protected function setUp(): void
$this->subject = $this->get(FrontendUserGroupRepository::class);
}

/**
* @test
*/
public function implementsRepositoryInterface(): void
{
self::assertInstanceOf(RepositoryInterface::class, $this->subject);
}

/**
* @test
*/
public function isRepository(): void
{
self::assertInstanceOf(Repository::class, $this->subject);
}

/**
* @test
*/
public function implementsDirectPersistInterface(): void
{
self::assertInstanceOf(DirectPersistInterface::class, $this->subject);
}

/**
* @test
*/
Expand Down
27 changes: 27 additions & 0 deletions Tests/Functional/Domain/Repository/FrontendUserRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
use OliverKlee\FeUserExtraFields\Domain\Model\FrontendUser;
use OliverKlee\FeUserExtraFields\Domain\Model\FrontendUserGroup;
use OliverKlee\FeUserExtraFields\Domain\Model\Gender;
use OliverKlee\FeUserExtraFields\Domain\Repository\DirectPersistInterface;
use OliverKlee\FeUserExtraFields\Domain\Repository\FrontendUserRepository;
use TYPO3\CMS\Extbase\Domain\Model\FileReference;
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
use TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface;
use TYPO3\CMS\Extbase\Persistence\Repository;
use TYPO3\CMS\Extbase\Persistence\RepositoryInterface;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;

/**
Expand All @@ -34,6 +37,30 @@ protected function setUp(): void
$this->subject = $this->get(FrontendUserRepository::class);
}

/**
* @test
*/
public function implementsRepositoryInterface(): void
{
self::assertInstanceOf(RepositoryInterface::class, $this->subject);
}

/**
* @test
*/
public function isRepository(): void
{
self::assertInstanceOf(Repository::class, $this->subject);
}

/**
* @test
*/
public function implementsDirectPersistInterface(): void
{
self::assertInstanceOf(DirectPersistInterface::class, $this->subject);
}

/**
* @test
*/
Expand Down
57 changes: 0 additions & 57 deletions Tests/Unit/Domain/Repository/FrontendUserGroupRepositoryTest.php

This file was deleted.

57 changes: 0 additions & 57 deletions Tests/Unit/Domain/Repository/FrontendUserRepositoryTest.php

This file was deleted.

0 comments on commit af7d53d

Please sign in to comment.