From 77057e06a81139556fb170d10cd2be647a954426 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Tue, 20 Jun 2023 09:10:31 +0200 Subject: [PATCH] [TASK] Make the repository tests more fine-grained (#855) Tests should only test one thing (if possible). --- .../Repository/Product/TeaRepositoryTest.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Tests/Functional/Domain/Repository/Product/TeaRepositoryTest.php b/Tests/Functional/Domain/Repository/Product/TeaRepositoryTest.php index 78d16ba..d771e7c 100644 --- a/Tests/Functional/Domain/Repository/Product/TeaRepositoryTest.php +++ b/Tests/Functional/Domain/Repository/Product/TeaRepositoryTest.php @@ -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()); }