summaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-11-04 16:03:45 +0100
committerJoas Schilling <coding@schilljs.com>2020-11-10 15:34:35 +0100
commit74c01430013ff813876c2f096e989c1e9886d762 (patch)
tree32f6c21154550e71f4d7aff5ed1b030631340fe9 /tests/lib
parente313777cd6e0a7255bf6f5c7ed151fa44ac536b0 (diff)
downloadnextcloud-server-74c01430013ff813876c2f096e989c1e9886d762.tar.gz
nextcloud-server-74c01430013ff813876c2f096e989c1e9886d762.zip
Easier debugging and spell fix
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/DB/ConnectionTest.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/lib/DB/ConnectionTest.php b/tests/lib/DB/ConnectionTest.php
index be84cb81cb3..5a2823ef28e 100644
--- a/tests/lib/DB/ConnectionTest.php
+++ b/tests/lib/DB/ConnectionTest.php
@@ -97,14 +97,17 @@ class ConnectionTest extends \Test\TestCase {
$this->assertTableNotExist('table');
}
- private function getTextValueByIntergerField($integerField) {
+ private function getTextValueByIntegerField($integerField) {
$builder = $this->connection->getQueryBuilder();
- $query = $builder->select('textfield')
+ $query = $builder->select('*')
->from('table')
->where($builder->expr()->eq('integerfield', $builder->createNamedParameter($integerField, IQueryBuilder::PARAM_INT)));
$result = $query->execute();
- return $result->fetchColumn();
+ $row = $result->fetch();
+ $result->closeCursor();
+
+ return $row['textfield'] ?? null;
}
public function testSetValues() {
@@ -116,7 +119,7 @@ class ConnectionTest extends \Test\TestCase {
'clobfield' => 'not_null'
]);
- $this->assertEquals('foo', $this->getTextValueByIntergerField(1));
+ $this->assertEquals('foo', $this->getTextValueByIntegerField(1));
}
public function testSetValuesOverWrite() {
@@ -133,7 +136,7 @@ class ConnectionTest extends \Test\TestCase {
'textfield' => 'bar'
]);
- $this->assertEquals('bar', $this->getTextValueByIntergerField(1));
+ $this->assertEquals('bar', $this->getTextValueByIntegerField(1));
}
public function testSetValuesOverWritePrecondition() {
@@ -154,7 +157,7 @@ class ConnectionTest extends \Test\TestCase {
'booleanfield' => true
]);
- $this->assertEquals('bar', $this->getTextValueByIntergerField(1));
+ $this->assertEquals('bar', $this->getTextValueByIntegerField(1));
}