|
|
@ -338,6 +338,43 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase |
|
|
|
* @runInSeparateProcess |
|
|
|
* @group Mongo |
|
|
|
*/ |
|
|
|
public function testCount() |
|
|
|
{ |
|
|
|
if (!defined('DEBUG')) { |
|
|
|
define('DEBUG', true); |
|
|
|
} |
|
|
|
$this->setDriverGetConnectionMethod()->setRequestForFetch(); |
|
|
|
|
|
|
|
$this->stmt->execute(); |
|
|
|
$this->assertSame(10, $this->stmt->count()); |
|
|
|
|
|
|
|
$this->stmt->fetch(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @runInSeparateProcess |
|
|
|
* @group Mongo |
|
|
|
*/ |
|
|
|
public function testCountException() |
|
|
|
{ |
|
|
|
if (!defined('DEBUG')) { |
|
|
|
define('DEBUG', true); |
|
|
|
} |
|
|
|
$this->setDriverGetConnectionMethod(); |
|
|
|
$this->request |
|
|
|
->expects($this->once()) |
|
|
|
->method('execute') |
|
|
|
->will($this->returnValue(array('some' => 'val'))); |
|
|
|
|
|
|
|
$this->stmt->execute(); |
|
|
|
$this->setExpectedException('GeneralException', 'MongoStatement error. Impossible count result of opened cursor'); |
|
|
|
$this->stmt->count(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @runInSeparateProcess |
|
|
|
* @group Mongo |
|
|
|
*/ |
|
|
|
public function testOrderException() |
|
|
|
{ |
|
|
|
if (!defined('DEBUG')) { |
|
|
|