diff options
author | Julius Härtl <jus@bitgrid.net> | 2023-01-29 09:40:17 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2023-01-31 11:57:54 +0100 |
commit | c246edece6432e6a0f28f14ac93131e8439e4fe7 (patch) | |
tree | d768de79cf8f4799cb5c2745f27342fe569240fc /tests | |
parent | e7c9fdb1ac1765972b811d17556fdb74fa7a2051 (diff) | |
download | nextcloud-server-c246edece6432e6a0f28f14ac93131e8439e4fe7.tar.gz nextcloud-server-c246edece6432e6a0f28f14ac93131e8439e4fe7.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>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/DB/QueryBuilder/ExpressionBuilderDBTest.php | 18 |
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') |