在我的phpunit测试中,我require_once了一个api_key.php,当然在我的.gitignore中也有(它包含了我自己的api密钥)。
<?php
namespace Domoticzapi;
use PHPUnit\Framework\TestCase;
require_once('api_key.php');
class ClientTest extends TestCase {
}审查员抱怨
PHP Warning: require_once(api_key.php): failed to open stream: No such file or directory in /home/scrutinizer/build/tests/Domoticzapi/ClientTest.php on line 6如何排除此检查?或者有没有最好的方法(除了我不想使用的环境变量)?
发布于 2018-06-20 04:48:34
,您需要将测试命令设置为仅运行所需的套件测试,或者提供新的phpunit配置,而不包含那些需要api_key.php的测试套件。
请参阅:How to run a specific phpunit xml testsuite? https://scrutinizer-ci.com/docs/build/running_tests_in_parallel
https://stackoverflow.com/questions/50936624
复制相似问题