From: Julius Härtl Date: Sun, 29 Jan 2023 08:40:17 +0000 (+0100) Subject: tests(oci): Test where statement on longtext column X-Git-Tag: v26.0.0beta2~17^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c246edece6432e6a0f28f14ac93131e8439e4fe7;p=nextcloud-server.git tests(oci): Test where statement on longtext column Signed-off-by: Julius Härtl test: try with just passing the type to eq which should also cast Signed-off-by: Julius Härtl --- diff --git a/tests/lib/DB/QueryBuilder/ExpressionBuilderDBTest.php b/tests/lib/DB/QueryBuilder/ExpressionBuilderDBTest.php index 4a168cb0143..35d8b4faa34 100644 --- a/tests/lib/DB/QueryBuilder/ExpressionBuilderDBTest.php +++ b/tests/lib/DB/QueryBuilder/ExpressionBuilderDBTest.php @@ -132,6 +132,24 @@ class ExpressionBuilderDBTest extends TestCase { $this->assertEquals(1, $result); } + public function testLongText(): void { + $appId = $this->getUniqueID('testing'); + $this->createConfig($appId, 'mykey', 'myvalue'); + + $query = $this->connection->getQueryBuilder(); + $query->select('*') + ->from('appconfig') + ->where($query->expr()->eq('appid', $query->createNamedParameter($appId))) + ->andWhere($query->expr()->eq('configkey', $query->createNamedParameter('mykey'))) + ->andWhere($query->expr()->eq('configvalue', $query->createNamedParameter('myvalue', IQueryBuilder::PARAM_STR), IQueryBuilder::PARAM_STR)); + + $result = $query->executeQuery(); + $entries = $result->fetchAll(); + $result->closeCursor(); + self::assertCount(1, $entries); + self::assertEquals('myvalue', $entries[0]['configvalue']); + } + protected function createConfig($appId, $key, $value) { $query = $this->connection->getQueryBuilder(); $query->insert('appconfig')