mirror of
https://github.com/FriendsOfTYPO3/tea.git
synced 2024-11-10 00:56:12 +01:00
[TASK] Make the repository tests more fine-grained (#855)
Tests should only test one thing (if possible).
This commit is contained in:
parent
7616ed60f7
commit
77057e06a8
1 changed files with 15 additions and 2 deletions
|
@ -70,14 +70,27 @@ final class TeaRepositoryTest extends FunctionalTestCase
|
|||
/**
|
||||
* @test
|
||||
*/
|
||||
public function findByUidForExistingRecordReturnsModelWithData(): void
|
||||
public function findByUidForExistingRecordReturnsModel(): void
|
||||
{
|
||||
$this->importCSVDataSet(__DIR__ . '/../Fixtures/Product/Tea.csv');
|
||||
|
||||
$uid = 1;
|
||||
$model = $this->subject->findByUid($uid);
|
||||
|
||||
self::assertNotNull($model);
|
||||
self::assertInstanceOf(Tea::class, $model);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function findByUidForExistingRecordMapsAllScalarData(): void
|
||||
{
|
||||
$this->importCSVDataSet(__DIR__ . '/../Fixtures/Product/Tea.csv');
|
||||
|
||||
$uid = 1;
|
||||
$model = $this->subject->findByUid($uid);
|
||||
self::assertInstanceOf(Tea::class, $model);
|
||||
|
||||
self::assertSame('Earl Grey', $model->getTitle());
|
||||
self::assertSame('Fresh and hot.', $model->getDescription());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue