PhpUnit测试通过,缺少参数1
运行测试时,会发出以下警告: 缺少…的参数1 unittest通过了,有可能让测试失败吗 这是我的PhpUnit.xmlPhpUnit测试通过,缺少参数1,php,phpunit,Php,Phpunit,运行测试时,会发出以下警告: 缺少…的参数1 unittest通过了,有可能让测试失败吗 这是我的PhpUnit.xml <phpunit bootstrap="bootstrap.php" colors="false" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true
<phpunit bootstrap="bootstrap.php"
colors="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
strict="true">
<selenium>
<browser name="Internet Explorer" browser="*iexplore" />
<browser name="Firefox" browser="*firefox" />
</selenium>
<filter>
<whitelist>
<directory>../src</directory>
</whitelist>
</filter>
<testsuites>
<testsuite name="unitTests">
<directory suffix="Test.php">*</directory>
</testsuite>
</testsuites>
<logging>
<log type="coverage-html" target="../build/coverage" />
<log type="coverage-clover" target="../build/logs/clover.xml" />
<log type="coverage-crap4j" target="../build/logs/crap4j.xml" />
</logging>
</phpunit>
../src
*
这是php日志:
xx函数()缺少参数1,在第37行的xx中调用并已定义(错误类型:在第78行的xx中出现警告)我找到了一个有点粗俗的解决方案:)
class THE_GREATEST_EVER_PHPUnit_Framework_TestCase extends \PHPUnit_Framework_TestCase
{
public static function setUpBeforeClass() {
set_error_handler(function($errno, $errstr, $errfile, $errline) {
throw new \RuntimeException($errstr . " on line " . $errline . " in file " . $errfile);
});
}
public function tearDown() {
restore_error_handler();
}
}