Codeception / Codeception/module-db

[Db] Change to disconnect on initialise breaks tests where Db is used in _beforeSuite

オープン
#18 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
PHP
スター
23
フォーク
31
PR マージ指標
30日以内にマージされた PR はありません

説明

#### What are you trying to achieve?

A helper runs code to modify the database in `_beforeSuite` in order to add control rows before any tests are run.

#### What do you get instead?

The code crashes upon trying to run SQL as the connection has been terminated. This was new behaviour added by https://github.com/Codeception/Codeception/commit/5e2c999df9eae7ff4f802eb801940f87088f0fc7

Easiest fix would be to create a public method on `Db` to ensure that the connection is open before running code if config has reconnect. The quickest route would just be to make `connect()` public.

### Details

* Codeception version: 2.2.11
* PHP Version: 7.0.19
* Operating System: Ubuntu 16.04 LTS
* Installation type: Composer
* List of installed packages (`composer show`) not relevant
* Suite configuration:

```yml
config:
Db:
dsn: 'mysql:host=localhost;dbname=XXXX;charset=utf8'
user: 'root'
password: ''
dump: 'tests/_data/schema.sql'
populate: true
cleanup: false
reconnect: true
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。