mirror of
https://github.com/FriendsOfTYPO3/tea.git
synced 2024-11-10 01:16:12 +01:00
[TASK] Split up the DB fixtures for the functional tests (#993)
This makes the fixture more minimal and reduces cross-dependencies between tests. Also consistently avoid quotes for integer data in CSV DB fixtures. Fixes #988
This commit is contained in:
parent
d15bd079d6
commit
d9718fd054
8 changed files with 27 additions and 18 deletions
|
@ -1,8 +0,0 @@
|
|||
"tx_tea_domain_model_product_tea"
|
||||
,"uid","pid","title","description","image","owner"
|
||||
,"1","1","Earl Grey","Fresh and hot.",0,2
|
||||
,"2","1","Assam","Dark and strong.",0,0
|
||||
,"3","1","Gunpowder","Bitter and very green.",1,0
|
||||
"sys_file_reference"
|
||||
,"uid","pid","uid_foreign","tablenames","fieldname"
|
||||
,"1","1","3","tx_tea_domain_model_product_tea","image"
|
Can't render this file because it contains an unexpected character in line 2 and column 2.
|
|
@ -0,0 +1,3 @@
|
|||
"tx_tea_domain_model_product_tea"
|
||||
,"uid","pid","title"
|
||||
,1,1,"Earl Grey"
|
Can't render this file because it has a wrong number of fields in line 2.
|
|
@ -0,0 +1,3 @@
|
|||
"tx_tea_domain_model_product_tea"
|
||||
,"uid","pid","title","description","owner"
|
||||
,1,1,"Earl Grey","Fresh and hot.",2
|
Can't render this file because it has a wrong number of fields in line 2.
|
|
@ -0,0 +1,7 @@
|
|||
"tx_tea_domain_model_product_tea"
|
||||
,"uid","pid","title","image",
|
||||
,1,1,"Gunpowder",1
|
||||
|
||||
"sys_file_reference"
|
||||
,"uid","uid_foreign","tablenames","fieldname"
|
||||
,1,1,"tx_tea_domain_model_product_tea","image"
|
Can't render this file because it contains an unexpected character in line 2 and column 2.
|
|
@ -1,3 +1,3 @@
|
|||
"tx_tea_domain_model_product_tea"
|
||||
,"uid","pid","title","owner"
|
||||
,"1","1","Earl Grey",0
|
||||
,1,1,"Earl Grey",0
|
||||
|
|
Can't render this file because it has a wrong number of fields in line 2.
|
|
@ -1,4 +1,4 @@
|
|||
"tx_tea_domain_model_product_tea"
|
||||
,"uid","pid","title","owner"
|
||||
,"1","1","Earl Grey",1
|
||||
,"2","1","Assam",1
|
||||
,1,1,"Earl Grey",1
|
||||
,2,1,"Assam",1
|
||||
|
|
Can't render this file because it has a wrong number of fields in line 2.
|
|
@ -0,0 +1,4 @@
|
|||
"tx_tea_domain_model_product_tea"
|
||||
,"uid","pid","title"
|
||||
,1,1,"Earl Grey"
|
||||
,2,1,"Assam"
|
Can't render this file because it has a wrong number of fields in line 2.
|
|
@ -46,11 +46,11 @@ final class TeaRepositoryTest extends FunctionalTestCase
|
|||
*/
|
||||
public function findAllWithRecordsFindsRecordsFromAllPages(): void
|
||||
{
|
||||
$this->importCSVDataSet(__DIR__ . '/../Fixtures/Product/Tea.csv');
|
||||
$this->importCSVDataSet(__DIR__ . '/../Fixtures/Product/TeaOnPage.csv');
|
||||
|
||||
$result = $this->subject->findAll();
|
||||
|
||||
self::assertGreaterThanOrEqual(1, \count($result));
|
||||
self::assertCount(1, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -58,7 +58,7 @@ final class TeaRepositoryTest extends FunctionalTestCase
|
|||
*/
|
||||
public function findAllSortsByTitleInAscendingOrder(): void
|
||||
{
|
||||
$this->importCSVDataSet(__DIR__ . '/../Fixtures/Product/Tea.csv');
|
||||
$this->importCSVDataSet(__DIR__ . '/../Fixtures/Product/TwoUnsortedTeas.csv');
|
||||
|
||||
$result = $this->subject->findAll();
|
||||
|
||||
|
@ -71,7 +71,7 @@ final class TeaRepositoryTest extends FunctionalTestCase
|
|||
*/
|
||||
public function findByUidForExistingRecordReturnsModel(): void
|
||||
{
|
||||
$this->importCSVDataSet(__DIR__ . '/../Fixtures/Product/Tea.csv');
|
||||
$this->importCSVDataSet(__DIR__ . '/../Fixtures/Product/TeaWithAllScalarData.csv');
|
||||
|
||||
$model = $this->subject->findByUid(1);
|
||||
|
||||
|
@ -83,7 +83,7 @@ final class TeaRepositoryTest extends FunctionalTestCase
|
|||
*/
|
||||
public function findByUidForExistingRecordMapsAllScalarData(): void
|
||||
{
|
||||
$this->importCSVDataSet(__DIR__ . '/../Fixtures/Product/Tea.csv');
|
||||
$this->importCSVDataSet(__DIR__ . '/../Fixtures/Product/TeaWithAllScalarData.csv');
|
||||
|
||||
$model = $this->subject->findByUid(1);
|
||||
self::assertInstanceOf(Tea::class, $model);
|
||||
|
@ -98,9 +98,9 @@ final class TeaRepositoryTest extends FunctionalTestCase
|
|||
*/
|
||||
public function fillsImageRelation(): void
|
||||
{
|
||||
$this->importCSVDataSet(__DIR__ . '/../Fixtures/Product/Tea.csv');
|
||||
$this->importCSVDataSet(__DIR__ . '/../Fixtures/Product/TeaWithImage.csv');
|
||||
|
||||
$model = $this->subject->findByUid(3);
|
||||
$model = $this->subject->findByUid(1);
|
||||
|
||||
$image = $model->getImage();
|
||||
self::assertInstanceOf(FileReference::class, $image);
|
||||
|
|
Loading…
Reference in a new issue