Skip to content

Commit

Permalink
[TASK] Move a repository test from unit to functional (#1484)
Browse files Browse the repository at this point in the history
Unit tests for repositories are quite a hassle as we then need to
set up all dependencies in `setUp()` ourselves.

So convert the test to a functional tests where we can rely on the
container to create and initialize the subject for us.
  • Loading branch information
oliverklee authored Oct 6, 2024
1 parent f93c998 commit 9446d14
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 39 deletions.
9 changes: 9 additions & 0 deletions Tests/Functional/Domain/Repository/TeaRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use TTN\Tea\Domain\Repository\TeaRepository;
use TYPO3\CMS\Extbase\Domain\Model\FileReference;
use TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface;
use TYPO3\CMS\Extbase\Persistence\Repository;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;

/**
Expand All @@ -31,6 +32,14 @@ protected function setUp(): void
$this->subject = $this->get(TeaRepository::class);
}

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

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

This file was deleted.

0 comments on commit 9446d14

Please sign in to comment.