Skip to content
Permalink
Browse files

Adding missing test case form previous commit

  • Loading branch information...
lorenzo committed Dec 31, 2012
1 parent 49fd02c commit 8555ff5fb3f3367f81589df3bb6ea3717ac78565
Showing with 17 additions and 0 deletions.
  1. +17 −0 lib/Cake/Test/TestCase/Model/Datasource/Database/QueryTest.php
@@ -467,4 +467,21 @@ public function testSelectOrWhereNoPreviousCondition() {
$this->assertEquals(['id' => 2], $result->fetch('assoc'));
}
/**
* Tests that Query::andWhere() can be used without calling where() before
*
* @return void
**/
public function testSelectAndWhereNoPreviousCondition() {
$this->_insertDateRecords();
$query = new Query($this->connection);
$result = $query
->select(['id'])
->from('dates')
->andWhere(['posted' => new \DateTime('2012-12-21 12:00')], ['posted' => 'datetime'])
->andWhere(['id' => 1])
->execute();
$this->assertCount(1, $result);
$this->assertEquals(['id' => 1], $result->fetch('assoc'));
}
}

0 comments on commit 8555ff5

Please sign in to comment.
You can’t perform that action at this time.