Codeception / Codeception/AspectMock

Non-existent functions can't be mocked since 2.1.0

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

説明

The problem was introduced here:
https://github.com/Codeception/AspectMock/pull/133/files#diff-50b2697c4aa86740dcae323b3d7ebe44R44

The `placeOptionalAndReferenceFunction` method uses `ReflectionFunction` which throws an exception if a non-existent function name is passed:

> [ReflectionException] Function somefunc() does not exist

Before that change it worked fine when trying to mock a non-existent function. This is a valid use case for a plugin architecture where you may not have desired functions in a test environment.

Can it be like this, for example:
```php
if (function_exists($function)) {
$this->placeOptionalAndReferenceFunction($namespace, $function);
}
```

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

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

評価

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

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

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