mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2024-09-19 23:16:12 +02:00

Compare commits

..

2 commits

Author SHA1 Message Date
Karsten Nowak
58fd272bc0 [TASK] Rename test functions
Related #1120
2024-07-30 20:30:50 +02:00
Karsten Nowak
ed4d0aee72 [TASK] Check that existing teas in other pids were not deleted
Related #1120
2024-07-30 20:19:18 +02:00
4 changed files with 29 additions and 8 deletions

View file

@ -78,7 +78,7 @@ class CreateTestDataCommandTest extends FunctionalTestCase
/**
* @test
*/
public function testDataGetsCreated(): void
public function createsTestData(): void
{
$this->commandTester->execute([
'pageUid' => '1',
@ -90,7 +90,7 @@ class CreateTestDataCommandTest extends FunctionalTestCase
/**
* @test
*/
public function testDataGetsDeletedBeforeNewDataCreated(): void
public function deletesExistingDataOnGivenPidBeforeCreatingNewData(): void
{
$this->importCSVDataSet(__DIR__ . '/Fixtures/Database/ExistingTeas.csv');
$this->commandTester->execute(
@ -103,4 +103,19 @@ class CreateTestDataCommandTest extends FunctionalTestCase
self::assertCSVDataSet(__DIR__ . '/Fixtures/Database/TeasAfterDelete.csv');
}
/**
* @test
*/
public function doesNotDeleteDataOnOtherPid(): void
{
$this->importCSVDataSet(__DIR__ . '/Fixtures/Database/OtherExistingTeas.csv');
$this->commandTester->execute(
[
'pageUid' => '1',
'--delete-data-before' => true,
]
);
self::assertCSVDataSet(__DIR__ . '/Fixtures/Database/TeasAfterDeleteOtherExistingTeas.csv');
}
}

View file

@ -0,0 +1,6 @@
"tx_tea_domain_model_tea"
,"uid","pid","title","description","deleted"
,3,1,"Darjeeling","Exists and should be deleted","0"
,4,1,"Earl Grey","Exists and should be deleted","0"
,1,2,"Darjeeling","Which already existed in the system",0
,2,2,"Earl Grey","Which already existed in the system",0
Can't render this file because it has a wrong number of fields in line 2.

View file

@ -1,6 +0,0 @@
"tx_tea_domain_model_tea"
,"uid","pid","title","description","deleted"
,3,1,"Darjeeling","I love that tea!","0"
,4,1,"Earl Grey","A nice tea!","0"
,1,2,"Black tea","I hate that.","0"
,2,2,"Green tea","Is ok.","0"
Can't render this file because it has a wrong number of fields in line 2.

View file

@ -0,0 +1,6 @@
"tx_tea_domain_model_tea"
,"pid","title","description","deleted"
,1,"Darjeeling","I love that tea!",0
,1,"Earl Grey","A nice tea!",0
,2,"Darjeeling","Which already existed in the system",0
,2,"Earl Grey","Which already existed in the system",0
Can't render this file because it has a wrong number of fields in line 2.