Skip to content

Commit dc624a1

Browse files
committed
tests(oci): Test where statement on longtext column
Signed-off-by: Julius Härtl <[email protected]> test: try with just passing the type to eq which should also cast Signed-off-by: Julius Härtl <[email protected]>
1 parent 0683dd1 commit dc624a1

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/lib/DB/QueryBuilder/ExpressionBuilderDBTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,24 @@ public function testCastColumn(): void {
132132
$this->assertEquals(1, $result);
133133
}
134134

135+
public function testLongText(): void {
136+
$appId = $this->getUniqueID('testing');
137+
$this->createConfig($appId, 'mykey', 'myvalue');
138+
139+
$query = $this->connection->getQueryBuilder();
140+
$query->select('*')
141+
->from('appconfig')
142+
->where($query->expr()->eq('appid', $query->createNamedParameter($appId)))
143+
->andWhere($query->expr()->eq('configkey', $query->createNamedParameter('mykey')))
144+
->andWhere($query->expr()->eq('configvalue', $query->createNamedParameter('myvalue', IQueryBuilder::PARAM_STR), IQueryBuilder::PARAM_STR));
145+
146+
$result = $query->executeQuery();
147+
$entries = $result->fetchAll();
148+
$result->closeCursor();
149+
self::assertCount(1, $entries);
150+
self::assertEquals('myvalue', $entries[0]['configvalue']);
151+
}
152+
135153
protected function createConfig($appId, $key, $value) {
136154
$query = $this->connection->getQueryBuilder();
137155
$query->insert('appconfig')

0 commit comments

Comments
 (0)