From f1a0fbef047240cc214f1bc73257bfe9ff6d73ab Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Fri, 29 Apr 2022 14:27:47 +0200 Subject: [PATCH] [CLEANUP] Use prepared statements for SQL queries in the tests (#443) Also add another type check to help with debugging failed queries. --- .../Domain/Repository/Product/TeaRepositoryTest.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Tests/Functional/Domain/Repository/Product/TeaRepositoryTest.php b/Tests/Functional/Domain/Repository/Product/TeaRepositoryTest.php index b956b91..a4359d3 100644 --- a/Tests/Functional/Domain/Repository/Product/TeaRepositoryTest.php +++ b/Tests/Functional/Domain/Repository/Product/TeaRepositoryTest.php @@ -129,14 +129,15 @@ class TeaRepositoryTest extends FunctionalTestCase $this->subject->add($model); $this->persistenceManager->persistAll(); - $connection = $this->getConnectionPool() - ->getConnectionForTable('tx_tea_domain_model_product_tea'); + $connection = $this->getConnectionPool()->getConnectionForTable('tx_tea_domain_model_product_tea'); $databaseRow = $connection ->executeQuery( - 'SELECT * FROM tx_tea_domain_model_product_tea WHERE uid = ' . $model->getUid() + 'SELECT * FROM tx_tea_domain_model_product_tea WHERE uid = :uid', + ['uid' => $model->getUid()] ) ->fetchAssociative(); + self::assertIsArray($databaseRow); self::assertSame($title, $databaseRow['title']); } }