'127.0.0.1', 'port' => 3306, 'user' => 'error', 'password' => 'error', 'database' => 'demo', 'timeout' => 5, 'charset' => 'utf8mb4', ]); $this->config = $config; $this->connection = new Connection($config); DbManager::getInstance()->addConnection($this->connection, 'error'); } public function testConnect() { /** @var Connection $connection */ $connection = DbManager::getInstance()->getConnection('error'); $pool = new MysqlPool($this->config); try { $obj = $pool->defer(1); } catch (\Exception $e) { $this->assertInstanceOf(Exception::class, $e); } } }