Skip to content

Commit 49dd990

Browse files
committed
More cursor closing
1 parent 17f2e99 commit 49dd990

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/TestCase/Database/ConnectionTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,14 @@ public function testExecuteWithArguments() {
147147
$this->assertCount(1, $statement);
148148
$result = $statement->fetch();
149149
$this->assertEquals([2], $result);
150+
$result->closeCursor();
150151

151152
$sql = 'SELECT 1 + ? + ? AS total';
152153
$statement = $this->connection->execute($sql, [2, 3], array('integer', 'integer'));
153154
$this->assertCount(1, $statement);
154155
$result = $statement->fetch('assoc');
155156
$this->assertEquals(['total' => 6], $result);
157+
$result->closeCursor();
156158

157159
$sql = 'SELECT 1 + :one + :two AS total';
158160
$statement = $this->connection->execute($sql, ['one' => 2, 'two' => 3], array('one' => 'integer', 'two' => 'integer'));
@@ -171,6 +173,7 @@ public function testExecuteWithArgumentsAndTypes() {
171173
$sql = "SELECT ? = '2012-01-01'";
172174
$statement = $this->connection->execute($sql, [new \DateTime('2012-01-01')], ['date']);
173175
$result = $statement->fetch();
176+
$result->closeCursor();
174177
$this->assertTrue((bool)$result[0]);
175178

176179
$sql = "SELECT ? = '2012-01-01', ? = '2000-01-01 10:10:10', ? = 2";

0 commit comments

Comments
 (0)