public function testEntitiesNoConnectionException() { $db = new MockMongoConnection($this->_testConfig + array('autoConnect' => false)); $this->expectException('Could not connect to the database.'); $result = $db->entities(null); }
public function testSettingNestedObjectDefaults() { $this->skipIf(!MockMongoConnection::enabled(), 'MongoDb not enabled.'); MockPost::$connection = new MockMongoConnection(); $schema = MockPost::schema(); MockPost::overrideSchema($schema + array('nested.value' => array( 'type' => 'string', 'default' => 'foo' ))); $this->assertEqual('foo', MockPost::create()->nested->value); $data = array('nested' => array('value' => 'bar')); $this->assertEqual('bar', MockPost::create($data)->nested->value); MockPost::overrideSchema($schema); MockPost::$connection = null; }