Skip to content

Commit

Permalink
More blind coding
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Mar 29, 2014
1 parent 386f7a3 commit 38cbc17
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/TestCase/Database/ConnectionTest.php
Expand Up @@ -225,11 +225,12 @@ public function testInsertWithMatchingTypes() {
['id' => 'integer', 'title' => 'string', 'body' => 'string']
);
$this->assertInstanceOf('Cake\Database\StatementInterface', $result);
$result->closeCursor();
$result = $this->connection->execute('SELECT * from things');
$this->assertCount(1, $result);
$row = $result->fetch('assoc');
$this->assertEquals($data, $row);
$result->closeCursor();
$this->assertEquals($data, $row);
}

/**
Expand All @@ -246,12 +247,13 @@ public function testInsertWithPositionalTypes() {
$data,
['integer', 'string', 'string']
);
$result->closeCursor();
$this->assertInstanceOf('Cake\Database\StatementInterface', $result);
$result = $this->connection->execute('SELECT * from things');
$this->assertCount(1, $result);
$row = $result->fetch('assoc');
$this->assertEquals($data, $row);
$result->closeCursor();
$this->assertEquals($data, $row);
}

/**
Expand All @@ -273,6 +275,7 @@ protected function _insertTwoRecords() {
$result->bindValue(2, 'another title');
$result->bindValue(3, 'another body');
$result->execute();
$result->closeCursor();
}

/**
Expand Down

0 comments on commit 38cbc17

Please sign in to comment.