added MongoStatement method to count results before skip/limit
This commit is contained in:
@ -197,6 +197,21 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
||||
* @runInSeparateProcess
|
||||
* @group Mongo
|
||||
*/
|
||||
public function testCursorCount()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
$mongo = new MongoDriver($this->conf);
|
||||
$this->assertEquals(5, $mongo->find('items')->count(5));
|
||||
$this->assertCount(3, $mongo->find('items')->limit(3)->fetchAll());
|
||||
$this->assertEquals(5, $mongo->count('items'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @runInSeparateProcess
|
||||
* @group Mongo
|
||||
*/
|
||||
public function testGet()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
|
Reference in New Issue
Block a user