Skip to content
Permalink
Browse files

Added test to show how to use isEmpty() on a query

  • Loading branch information...
lorenzo committed May 4, 2015
1 parent bac36e0 commit 87371067166f9272a5dc57482863fb30eeef4512
Showing with 12 additions and 0 deletions.
  1. +12 −0 tests/TestCase/ORM/QueryTest.php
@@ -2630,4 +2630,16 @@ public function testNotSoFarMatchingWithContainOnTheSameAssociation()
$this->assertCount(2, $result->tags);
$this->assertEquals(2, $result->_matchingData['tags']->id);
}
/**
* Tests that isEmpty() can be called on a query
*
* @return void
*/
public function testIsEmpty()
{
$table = TableRegistry::get('articles');
$this->assertFalse($table->find()->isEmpty());
$this->assertTrue($table->find()->where(['id' => -1])->isEmpty());
}
}

0 comments on commit 8737106

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