Inheritance: extends lithium\data\Model
Beispiel #1
0
 public function testGridFsDeleteWithCustomPrefix()
 {
     $data = array('_id' => new MongoId());
     $db = new MongoDb($this->_testConfig + array('gridPrefix' => 'custom'));
     $db->server = new MockMongoConnection();
     $db->connection = new MockMongoConnection();
     Connections::add('temp', array('object' => $db));
     MockMongoPost::config(array('meta' => array('source' => 'fs.files', 'connection' => 'temp')));
     MockMongoPost::create($data, array('exists' => true))->delete();
     $this->assertIdentical(null, $db->connection->gridFsPrefix);
     MockMongoPost::config(array('meta' => array('source' => 'custom.files')));
     MockMongoPost::create($data, array('exists' => true))->delete();
     $this->assertIdentical('custom', $db->connection->gridFsPrefix);
     Connections::remove('temp');
 }
Beispiel #2
0
 public function tearDown()
 {
     Connections::remove('mockconn');
     MockMongoPost::reset();
 }