Пример #1
0
 public function testInsert()
 {
     $schema = array('_id' => array('type' => 'id'), 'title' => array('type' => 'string', 'required' => true), 'name' => array('type' => 'string', 'required' => false), 'birthday' => array('type' => 'date', 'required' => true));
     $model = new BaseModel($this->connection);
     $model->setSchema($schema);
     $data = array('title' => 'Mr', 'name' => 'Robert', 'birthday' => new \MongoDate());
     $this->assertNotNull($model->insert($data));
 }