refactored MongoModel to hide fetch method, fixed PHPDoc errors
This commit is contained in:
@ -16,7 +16,7 @@ require_once dirname(__FILE__) . '/../../model/MongoDriver.php';
|
||||
require_once dirname(__FILE__) . '/../../model/MongoDbCommand.php';
|
||||
require_once dirname(__FILE__) . '/../../exception/GeneralException.php';
|
||||
|
||||
class MongoDbCommandTest extends PHPUnit_Framework_TestCase
|
||||
class MongoDbCommandTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
private $conf = array();
|
||||
@ -323,11 +323,14 @@ class MongoDbCommandTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testToString()
|
||||
{
|
||||
$cmd = MongoCommandBuilder::factory(MongoCommandBuilder::COUNT, new CollectionMock());
|
||||
$cmd->bindParam('condition', array());
|
||||
$cmd = MongoCommandBuilder::factory(MongoCommandBuilder::COUNT);
|
||||
$this->assertSame('Command properties not set', $cmd->__toString());
|
||||
$cmd->bindParam('collection', new CollectionMock());
|
||||
$this->assertStringStartsWith("\n" . 'Collection: CollectionMock', $cmd->__toString());
|
||||
|
||||
$cmd = MongoCommandBuilder::factory(MongoCommandBuilder::FIND, new CollectionMock());
|
||||
$cmd = MongoCommandBuilder::factory(MongoCommandBuilder::FIND);
|
||||
$this->assertSame('Command properties not set', $cmd->__toString());
|
||||
$cmd->bindParam('collection', new CollectionMock());
|
||||
$cmd->bindParam('condition', array());
|
||||
$this->assertStringStartsWith("\n" . 'Collection: CollectionMock', $cmd->__toString());
|
||||
$this->assertContains('Condition: ' . '[]' . PHP_EOL, $cmd->__toString());
|
||||
|
Reference in New Issue
Block a user