Codeception / Codeception/c3

Constant C3_CODECOVERAGE_MEDIATE_STORAGE can be used before it's defined

未关闭
#37 3 条评论 4 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
PHP
星标
73
派生
46
PR 合并指标
30 天内没有已合并 PR

描述

If these lines fail:

```php
try {
\Codeception\Configuration::config($config_file);
} catch (\Exception $e) {
__c3_error($e->getMessage());
}
```

due to `\Codeception\Configuration` not existing, then

```php
$errorLogFile = defined('C3_CODECOVERAGE_ERROR_LOG_FILE') ?
C3_CODECOVERAGE_ERROR_LOG_FILE :
C3_CODECOVERAGE_MEDIATE_STORAGE . DIRECTORY_SEPARATOR . 'error.txt';
```

is called before

```php
define('C3_CODECOVERAGE_MEDIATE_STORAGE', Codeception\Configuration::logDir() . 'c3tmp');
define('C3_CODECOVERAGE_PROJECT_ROOT', Codeception\Configuration::projectDir());
define('C3_CODECOVERAGE_TESTNAME', $_SERVER['HTTP_X_CODECEPTION_CODECOVERAGE']);
```
is run.

贡献指南

这个仓库没有索引到贡献指南

调研方向

Locate the __c3_error handler and the code that defines C3_CODECOVERAGE_MEDIATE_STORAGE, then trace the failure path when Codeception\Configuration is unavailable. Reproduce that path and ensure the error-log fallback does not use the constant before it is defined.

由索引模型根据 Issue 内容生成。

评估

技术栈
php
领域
testing
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。