Skip to content

Commit

Permalink
[TASK] Migrate DB queries to CSV assertions in the functional tests (#…
Browse files Browse the repository at this point in the history
…998)

This makes the corresponding test a lot more concise and easier to
read.
  • Loading branch information
oliverklee authored Nov 19, 2023
1 parent f604ec2 commit d15bd07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"tx_tea_domain_model_product_tea"
,"uid","title"
,1,"Godesberger Burgtee"
11 changes: 1 addition & 10 deletions Tests/Functional/Domain/Repository/Product/TeaRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,7 @@ public function addAndPersistAllCreatesNewRecord(): void
$this->subject->add($model);
$this->persistenceManager->persistAll();

$connection = $this->getConnectionPool()->getConnectionForTable('tx_tea_domain_model_product_tea');
$databaseRow = $connection
->executeQuery(
'SELECT * FROM tx_tea_domain_model_product_tea WHERE uid = :uid',
['uid' => $model->getUid()]
)
->fetchAssociative();

self::assertIsArray($databaseRow);
self::assertSame($title, $databaseRow['title']);
$this->assertCSVDataSet(__DIR__ . '/../Fixtures/Product/PersistedTea.csv');
}

/**
Expand Down

0 comments on commit d15bd07

Please sign in to comment.