From 8be6d023151b2997c28558f8ad3a56cb8d729b21 Mon Sep 17 00:00:00 2001 From: Lina Wolf <48202465+linawolf@users.noreply.github.com> Date: Mon, 3 Oct 2022 19:10:08 +0200 Subject: [PATCH] [TASK] Convert functional test fixtures to CSV (#601) Fixes #600 Co-authored-by: lina.wolf --- CHANGELOG.md | 1 + .../Repository/Fixtures/Product/Tea.csv | 8 +++++ .../Repository/Fixtures/Product/Tea.xml | 29 ------------------- .../Repository/Product/TeaRepositoryTest.php | 8 ++--- 4 files changed, 13 insertions(+), 33 deletions(-) create mode 100644 Tests/Functional/Domain/Repository/Fixtures/Product/Tea.csv delete mode 100644 Tests/Functional/Domain/Repository/Fixtures/Product/Tea.xml diff --git a/CHANGELOG.md b/CHANGELOG.md index afbd77b..34e81aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). ### Added ### Changed +- Convert functional test fixtures to CSV (#601) - Use typed properties instead of `@var` annotations (#599) - Return `ResponseInterface` in controller actions (#597) - Replace switchable controller actions with separate plugins (#575) diff --git a/Tests/Functional/Domain/Repository/Fixtures/Product/Tea.csv b/Tests/Functional/Domain/Repository/Fixtures/Product/Tea.csv new file mode 100644 index 0000000..bc01acf --- /dev/null +++ b/Tests/Functional/Domain/Repository/Fixtures/Product/Tea.csv @@ -0,0 +1,8 @@ +"tx_tea_domain_model_product_tea" +,"uid","pid","title","description","image" +,"1","1","Earl Grey","Fresh and hot.",0 +,"2","1","Assam","Dark and strong.",0 +,"3","1","Gunpowder","Bitter and very green.",1 +"sys_file_reference" +,"uid","pid","uid_foreign","tablenames","fieldname" +,"1","1","3","tx_tea_domain_model_product_tea","image" diff --git a/Tests/Functional/Domain/Repository/Fixtures/Product/Tea.xml b/Tests/Functional/Domain/Repository/Fixtures/Product/Tea.xml deleted file mode 100644 index df3e9be..0000000 --- a/Tests/Functional/Domain/Repository/Fixtures/Product/Tea.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - 1 - 1 - Earl Grey - Fresh and hot. - - - 2 - 1 - Assam - Dark and strong. - - - 3 - 1 - Gunpowder - Bitter and very green. - 1 - - - 1 - 1 - 3 - tx_tea_domain_model_product_tea - image - - diff --git a/Tests/Functional/Domain/Repository/Product/TeaRepositoryTest.php b/Tests/Functional/Domain/Repository/Product/TeaRepositoryTest.php index 20dccaa..32c5382 100644 --- a/Tests/Functional/Domain/Repository/Product/TeaRepositoryTest.php +++ b/Tests/Functional/Domain/Repository/Product/TeaRepositoryTest.php @@ -57,7 +57,7 @@ class TeaRepositoryTest extends FunctionalTestCase */ public function findAllWithRecordsFindsRecordsFromAllPages(): void { - $this->importDataSet(__DIR__ . '/../Fixtures/Product/Tea.xml'); + $this->importCSVDataSet(__DIR__ . '/../Fixtures/Product/Tea.csv'); $result = $this->subject->findAll(); @@ -69,7 +69,7 @@ class TeaRepositoryTest extends FunctionalTestCase */ public function findAllSortsByTitleInAscendingOrder(): void { - $this->importDataSet(__DIR__ . '/../Fixtures/Product/Tea.xml'); + $this->importCSVDataSet(__DIR__ . '/../Fixtures/Product/Tea.csv'); $result = $this->subject->findAll(); @@ -82,7 +82,7 @@ class TeaRepositoryTest extends FunctionalTestCase */ public function findByUidForExistingRecordReturnsModelWithData(): void { - $this->importDataSet(__DIR__ . '/../Fixtures/Product/Tea.xml'); + $this->importCSVDataSet(__DIR__ . '/../Fixtures/Product/Tea.csv'); $uid = 1; /** @var Tea $model */ @@ -98,7 +98,7 @@ class TeaRepositoryTest extends FunctionalTestCase */ public function fillsImageRelation(): void { - $this->importDataSet(__DIR__ . '/../Fixtures/Product/Tea.xml'); + $this->importCSVDataSet(__DIR__ . '/../Fixtures/Product/Tea.csv'); $uid = 3; /** @var Tea $model */