Browse Source

More cursor closing

Jose Lorenzo Rodriguez 12 years ago
parent
commit
49dd990020
1 changed files with 3 additions and 0 deletions
  1. 3 0
      tests/TestCase/Database/ConnectionTest.php

+ 3 - 0
tests/TestCase/Database/ConnectionTest.php

@@ -147,12 +147,14 @@ class ConnectionTest extends TestCase {
 		$this->assertCount(1, $statement);
 		$result = $statement->fetch();
 		$this->assertEquals([2], $result);
+		$result->closeCursor();
 
 		$sql = 'SELECT 1 + ? + ? AS total';
 		$statement = $this->connection->execute($sql, [2, 3], array('integer', 'integer'));
 		$this->assertCount(1, $statement);
 		$result = $statement->fetch('assoc');
 		$this->assertEquals(['total' => 6], $result);
+		$result->closeCursor();
 
 		$sql = 'SELECT 1 + :one + :two AS total';
 		$statement = $this->connection->execute($sql, ['one' => 2, 'two' => 3], array('one' => 'integer', 'two' => 'integer'));
@@ -171,6 +173,7 @@ class ConnectionTest extends TestCase {
 		$sql = "SELECT ? = '2012-01-01'";
 		$statement = $this->connection->execute($sql, [new \DateTime('2012-01-01')], ['date']);
 		$result = $statement->fetch();
+		$result->closeCursor();
 		$this->assertTrue((bool)$result[0]);
 
 		$sql = "SELECT ? = '2012-01-01', ? = '2000-01-01 10:10:10', ? = 2";