public function testAnotherConnection() { $model = TestSchema::getCollection('another')->findOne(); $this->assertNull($model); $model = new TestSchema(['title' => '123']); $model->setConnectionName('another')->save(); $model = TestSchema::getCollection('another')->findOne($model->_id); $this->assertInstanceOf('\\Model\\Mongo\\TestSchema', $model); $this->assertEquals('123', $model->title); \Reach\Service\Container::get('another')->selectDB('reach_testing2')->drop(); \Reach\Service\Container::get('another')->close(); }