Skip to content

Commit

Permalink
Creating a more accurate test for unbuffered queries
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Jan 9, 2015
1 parent a303ab4 commit 23943c1
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions tests/TestCase/Database/QueryTest.php
Expand Up @@ -3143,22 +3143,20 @@ public function testUnbufferedQuery() {
->bufferResults(false)
->execute();

$this->assertCount(0, $result);
$list = $result->fetchAll('assoc');
$this->assertCount(3, $list);

$list = $result->fetchAll('assoc');
$this->assertCount(0, $list);
$result->closeCursor();

$query = new Query($this->connection);
$result = $query->select(['body', 'author_id'])
->from('articles')
->execute();

$this->assertCount(3, $result);
$list = $result->fetchAll('assoc');
$this->assertCount(3, $list);

$list = $result->fetchAll('assoc');
$this->assertCount(3, $list);
$result->closeCursor();
}

/**
Expand Down

0 comments on commit 23943c1

Please sign in to comment.