Skip to content

Commit

Permalink
tests(oci): Test where statement on longtext column
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
juliusknorr authored and blizzz committed Feb 7, 2023
1 parent 4ee9dee commit 9df31d7
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/lib/DB/QueryBuilder/ExpressionBuilderDBTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,24 @@ public function testCastColumn(): void {
$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')
Expand Down

0 comments on commit 9df31d7

Please sign in to comment.