PHP 7.1から7.4への移行。 APIには500の機能テストがあり、それらの一部は移行の完了後にエラーで失敗し始めました。これらのテストはどこでも成功し、現在はどこでも失敗しています。
環境情報:
スタックトレース:
...\api\vendor\codeception\codeception\src\Codeception\Subscriber\ErrorHandler.php:83
...\api\tests\functional\SomeFileHereCest.php:72
...\api\vendor\codeception\codeception\src\Codeception\Lib\Di.php:127
...\api\vendor\codeception\codeception\src\Codeception\Test\Cest.php:138
...\api\vendor\codeception\codeception\src\Codeception\Test\Cest.php:97
...\api\vendor\codeception\codeception\src\Codeception\Test\Cest.php:80
...\api\vendor\codeception\codeception\src\Codeception\Test\Test.php:88
... more stuff here, not important
ErrorHandler.php:83
これはエラーをキャッチしているだけなので、SomeFileHereCest.php:72
:
// declaration of the apiPrefix variable in the class.
protected $apiPrefix;
//...
public function _before(FunctionalTester $I)
{
$this->apiPrefix = $this->config['backend']['api_prefix']; // this is the line 72
//... more similar stuff later
したがって、$this->config['backend']['api_prefix']
これは文字列( "v1")です
そして、私はこれのどこに問題があるのか、そしてそれをより深く掘り下げる方法を見ません。何か案は?
変数が設定されていないようです。
次のisset呼び出しで確認します。
_isset($this->config);
isset($this->config['backend']);
isset($this->config['backend']['api_prefix']);
_
実際に1つのisset呼び出し(isset($x, $y, $z)
)で複数の変数を確認できますが、これにより、どの変数が欠落しているかを確認できます