]> source.dussan.org Git - nextcloud-server.git/commitdiff
tests(oci): Test where statement on longtext column
authorJulius Härtl <jus@bitgrid.net>
Sun, 29 Jan 2023 08:40:17 +0000 (09:40 +0100)
committerJulius Härtl <jus@bitgrid.net>
Tue, 31 Jan 2023 10:57:54 +0000 (11:57 +0100)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
test: try with just passing the type to eq which should also cast

Signed-off-by: Julius Härtl <jus@bitgrid.net>
tests/lib/DB/QueryBuilder/ExpressionBuilderDBTest.php

index 4a168cb014350002dac2a8c0aaa5ef86d9e70ebe..35d8b4faa343afacbcb5cf60164ad14e83ef9e30 100644 (file)
@@ -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')