summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2023-01-29 09:40:17 +0100
committerblizzz (Rebase PR Action) <blizzz@users.noreply.github.com>2023-02-07 13:15:44 +0000
commit9df31d7195544527a66b365e4c8d9801c1e81c1d (patch)
tree44ae1181222e14a2a1bc2c1c0cd9a6e1cde0af0f
parent4ee9deea00bbaf413ca4cd36d604a3a9bb3f1fa2 (diff)
downloadnextcloud-server-9df31d7195544527a66b365e4c8d9801c1e81c1d.tar.gz
nextcloud-server-9df31d7195544527a66b365e4c8d9801c1e81c1d.zip
tests(oci): Test where statement on longtext column
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>
-rw-r--r--tests/lib/DB/QueryBuilder/ExpressionBuilderDBTest.php18
1 files changed, 18 insertions, 0 deletions
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')