Codeception / Codeception/AspectMock
Incorrect cache files
- 主要言語
- PHP
- スター
- 784
- フォーク
- 132
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Invalid cache files creating when I run tests. In directory file looks like:
```
class Settings { if (($__am_res = __amock_before($this, __CLASS__, __FUNCTION__, array(), false)) !== __AM_CONTINUE__) return $__am_res;
...
```
After the test run I get the error message:
`[ParseError] syntax error, unexpected 'if' (T_IF), expecting function (T_FUNCTION) or const (T_CONST)
`
## Environment
- Codeception 4.1
- PHP7.2
- Aspect Mock 3.1
bootstrap.php
```
use AspectMock\Kernel;
define( 'PLUGIN_NAME_PATH', realpath( __DIR__ . '/../../../' ) . '/' );
$kernel = Kernel::getInstance();
$kernel->init(
[
'cacheDir' => PLUGIN_NAME_PATH . '.codeception/_cache/',
'debug' => true,
'includePaths' => [ PLUGIN_NAME_PATH . 'src/' ],
]
);
```
TestCase.php
```
use AspectMock\Test;
use Codeception\Test\Unit;
use AspectMock\Core\Registry;
abstract class TestCase extends Unit {
protected function _after(): void {
if ( Registry::$mocker ) {
Test::clean();
}
parent::_after();
}
}
```
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
bootstrap.php で設定された cacheDir から始め、テスト実行後に生成されたキャッシュファイルを調べます。キャッシュ出力を TestCase.php のクリーンアップフローと比較し、ParseError を再現します。テスト実行によって無効な PHP キャッシュファイルが作成されなくなれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- php
- 領域
- testing
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100