fixed ret value on eval

This commit is contained in:
Anton Grebnev
2012-04-13 16:22:52 +04:00
parent c090634c19
commit df491fdbbd
3 changed files with 26 additions and 9 deletions

View File

@ -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')) {