调用未定义的方法 PHP_CodeCoverage_Filter::addDirectoryToBlacklist()

Call to undefined method PHP_CodeCoverage_Filter::addDirectoryToBlacklist()

我在我的代码中尝试了 运行 PHP,它显示

$ ./vendor/bin/phpunit
PHP Fatal error:  Call to undefined method PHP_CodeCoverage_Filter::addDirectoryToBlacklist() in /home/petra/myproject/vendor/phpunit/phpunit/src/TextUI/TestRunner.php on line 979

以前是运行正常。

这里是 composer.json

"require-dev": {
    ...
    "phpunit/phpunit": "4.6.*", 
    ...
}

这是phpunit.xml的内容。

<phpunit bootstrap="./test/bootstrap.php">
    <testsuites>
        <testsuite name="Test">
            <directory>./test</directory>
        </testsuite>
    </testsuites>
</phpunit>

./test/bootstrap.php的内容就是这样

require dirname(__FILE__) . '/../vendor/autoload.php';

我做错了什么?

刚刚尝试手动将 phpunit/php-code-coverage 依赖项设置为 2.2.4,这有效。