fixed ret value on eval
This commit is contained in:
@ -369,6 +369,24 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
||||
* @runInSeparateProcess
|
||||
* @group Mongo
|
||||
*/
|
||||
public function testEval()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
$mongo = new MongoDriver($this->conf);
|
||||
$result = $mongo->command('items', array('$eval' => 'function() {return true; }'));
|
||||
$this->assertTrue($result->fetch());
|
||||
$result = $mongo->command('items', array('$eval' => 'function() {return "Hello"; }'));
|
||||
$this->assertSame('Hello', $result->fetch());
|
||||
$result = $mongo->command('items', array('$eval' => 'function() {return db.items.count(); }'));
|
||||
$this->assertEquals(5, $result->fetch());
|
||||
}
|
||||
|
||||
/**
|
||||
* @runInSeparateProcess
|
||||
* @group Mongo
|
||||
*/
|
||||
public function testCommand()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
|
Reference in New Issue
Block a user