Skip to content

Commit

Permalink
Added test to prove that it is possible to use any PDO fetchinig type
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Oct 24, 2014
1 parent b1ca01d commit 26b16e9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/TestCase/Database/ConnectionTest.php
Expand Up @@ -267,6 +267,19 @@ public function testStatementReusing() {
$this->assertEquals('another body', $row['body']);
}

/**
* Tests that it is possible to pass PDO constants to the underlying statement
* object for using alternate fetch types
*
* @return void
*/
public function testStatementFetchObject() {
$result = $this->connection->execute('SELECT title, body FROM things');
$row = $result->fetch(\PDO::FETCH_OBJ);
$this->assertEquals('a title', $row->title);
$this->assertEquals('a body', $row->body);
}

/**
* Tests rows can be updated without specifying any conditions nor types
*
Expand Down

0 comments on commit 26b16e9

Please sign in to comment.