sebastianbergmann / php-code-coverage

Library that provides collection, processing, and rendering functionality for PHP code coverage information.
BSD 3-Clause "New" or "Revised" License
8.8k stars 373 forks source link

Call to undefined method [...]RawCodeCoverageData::keepLineCoverageDataOnlyForLines() #896

Closed deoomen closed 2 years ago

deoomen commented 2 years ago
Q A
php-code-coverage version 9.2.11
PHP version 8.0.13+
Driver Xdebug
Xdebug version (if used) 3.1.3
Installation Method Composer
Usage Method PHPUnit / simple-phpunit (symfony/phpunit-bridge)
PHPUnit version (if used) 9.5.14

Summary

When running tests with --coverage-text option an exception is thrown:

Call to undefined method SebastianBergmann\CodeCoverage\RawCodeCoverageData::keepLineCoverageDataOnlyForLines()

composer info | sort:

acelaya/doctrine-enum-type                 v2.5.0      A custom Doctrine type that maps column values to enum objects using myclabs/php-enum
adyen/php-api-library                      11.0.0      A PHP client library for accessing Adyen APIs
beberlei/assert                            v3.3.2      Thin assertion library for input validation in business models.
brick/math                                 0.9.3       Arbitrary-precision arithmetic library
clue/stream-filter                         v1.5.0      A simple and modern approach to stream filtering in PHP
deoomen/clock-maestro                      v1.2.1      Single source of truth about time and date in your application
doctrine/annotations                       1.13.2      Docblock Annotations Parser
doctrine/cache                             2.1.1       PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis...
doctrine/collections                       1.6.8       PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.
doctrine/common                            3.2.2       PHP Doctrine Common project is a library that provides additional functionality that other Doctrine projects de...
doctrine/data-fixtures                     1.5.2       Data Fixtures for all Doctrine Object Managers
doctrine/dbal                              3.3.2       Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and managem...
doctrine/deprecations                      v0.5.3      A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecati...
doctrine/doctrine-bundle                   2.5.6       Symfony DoctrineBundle
doctrine/doctrine-fixtures-bundle          3.4.1       Symfony DoctrineFixturesBundle
doctrine/doctrine-migrations-bundle        3.2.2       Symfony DoctrineMigrationsBundle
doctrine/event-manager                     1.1.1       The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine pro...
doctrine/inflector                         2.0.4       PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase ...
doctrine/instantiator                      1.4.0       A small, lightweight utility to instantiate objects in PHP without invoking their constructors
doctrine/lexer                             1.2.2       PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.
doctrine/migrations                        3.4.1       PHP Doctrine Migrations project offer additional functionality on top of the database abstraction layer (DBAL) ...
doctrine/orm                               2.11.1      Object-Relational-Mapper for PHP
doctrine/persistence                       2.3.0       The Doctrine Persistence project is a set of shared interfaces and functionality that the different Doctrine ob...
doctrine/sql-formatter                     1.1.2       a PHP SQL highlighting library
dompdf/dompdf                              v1.2.0      DOMPDF is a CSS 2.1 compliant HTML to PDF converter
dvdoug/boxpacker                           3.9.4       An implementation of the 3D (actually 4D) bin packing/knapsack problem (aka creating parcels by putting items i...
egulias/email-validator                    3.1.2       A library for validating emails against several RFCs
exsyst/swagger                             v0.4.2      A php library to manipulate Swagger specifications
firebase/php-jwt                           v5.5.1      A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.
friendsofphp/proxy-manager-lts             v1.0.5      Adding support for a wider range of PHP versions to ocramius/proxy-manager
guzzlehttp/guzzle                          7.4.1       Guzzle is a PHP HTTP client library
guzzlehttp/promises                        1.5.1       Guzzle promises library
guzzlehttp/psr7                            2.1.0       PSR-7 message implementation that also provides common utility methods
hamcrest/hamcrest-php                      v2.0.1      This is the PHP port of Hamcrest Matchers
http-interop/http-factory-guzzle           1.2.0       An HTTP Factory using Guzzle PSR7
jane-php/json-schema                       v7.2.0      Generate a serializable / deserializable object model given a json schema
jane-php/json-schema-runtime               v7.0.0      Jane runtime Library
jane-php/open-api-3                        v7.2.0      Generate a PHP Client API (PSR7/PSR18 compatible) given a OpenApi 3.x specification
jane-php/open-api-common                   v7.2.0      Utility for OpenApi 2/3 generators
jane-php/open-api-runtime                  v7.0.0      Jane OpenAPI Runtime Library, dependencies and utility class for a library generated by jane/openapi
jean85/pretty-package-versions             2.0.5       A library to get pretty versions strings of installed dependencies
jms/metadata                               2.6.1       Class/method/property metadata management in PHP
jms/serializer                             3.17.1      Library for (de-)serializing data of any complexity; supports XML, JSON, and YAML.
knplabs/gaufrette                          v0.10.0     PHP library that provides a filesystem abstraction layer
knpuniversity/oauth2-client-bundle         v2.9.0      Integration with league/oauth2-client to provide services
laminas/laminas-code                       4.5.1       Extensions to the PHP Reflection API, static code scanning, and code generation
league/oauth2-client                       2.6.1       OAuth 2.0 Client Library
league/uri                                 6.5.0       URI manipulation library
league/uri-interfaces                      2.3.0       Common interface for URI representation
mhujer/jms-serializer-uuid                 3.4.1       Uuid serializer and deserializer for JMS Serializer library
mockery/mockery                            1.5.0       Mockery is a simple yet flexible PHP mock object framework
moneyphp/money                             v4.0.3      PHP implementation of Fowler's Money pattern
monolog/monolog                            2.3.5       Sends your logs to files, sockets, inboxes, databases and various web services
munusphp/munus                             0.4.0       Power of object-oriented programming with the elegance of functional programming.
myclabs/deep-copy                          1.10.2      Create deep copies (clones) of your objects
myclabs/php-enum                           1.8.3       PHP Enum implementation
nelmio/api-doc-bundle                      v3.9.1      Generates documentation for your REST API from annotations
nelmio/cors-bundle                         2.2.0       Adds CORS (Cross-Origin Resource Sharing) headers support in your Symfony application
nikic/php-parser                           v4.13.2     A PHP parser written in PHP
overblog/graphiql-bundle                   v0.2.1      Symfony GraphiQLBundle makes possible to render the UI into your symfony project
overblog/graphql-bundle                    v0.13.7     This bundle provides tools to build a GraphQL server in your Symfony App.
paragonie/random_compat                    v9.99.100   PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
phar-io/manifest                           2.0.3       Component for reading phar.io manifest information from a PHP Archive (PHAR)
phar-io/version                            3.1.1       Library for handling version information and constraints
phenx/php-font-lib                         0.5.4       A library to read, parse, export and make subsets of different types of font files.
phenx/php-svg-lib                          0.4.0       A library to read, parse and export to PDF SVG files.
php-http/client-common                     2.5.0       Common HTTP Client implementations and tools for HTTPlug
php-http/discovery                         1.14.1      Finds installed HTTPlug implementations and PSR-7 message factories
php-http/httplug                           2.2.0       HTTPlug, the HTTP client abstraction for PHP
php-http/logger-plugin                     1.3.0       PSR-3 Logger plugin for HTTPlug
php-http/message                           1.13.0      HTTP Message related tools
php-http/message-factory                   v1.0.2      Factory interfaces for PSR-7 HTTP Message
php-http/multipart-stream-builder          1.2.0       A builder class that help you create a multipart stream
php-http/promise                           1.1.0       Promise used for asynchronous HTTP requests
php-jsonpointer/php-jsonpointer            v3.0.2      Implementation of JSON Pointer (http://tools.ietf.org/html/rfc6901)
phpdocumentor/reflection-common            2.2.0       Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock          5.3.0       With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve informat...
phpdocumentor/type-resolver                1.6.0       A PSR-5 based resolver of Class names, Types and Structural Element Names
phpspec/prophecy                           v1.15.0     Highly opinionated mocking framework for PHP 5.3+
phpstan/phpdoc-parser                      1.2.0       PHPDoc parser with support for nullable, intersection and generic types
phpunit/php-code-coverage                  9.2.10      Library that provides collection, processing, and rendering functionality for PHP code coverage information.
phpunit/php-file-iterator                  3.0.6       FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-invoker                        3.1.1       Invoke callables with a timeout
phpunit/php-text-template                  2.0.4       Simple template engine.
phpunit/php-timer                          5.0.3       Utility class for timing
phpunit/phpunit                            9.5.13      The PHP Unit Testing framework.
psr/cache                                  2.0.0       Common interface for caching libraries
psr/container                              1.1.2       Common Container Interface (PHP FIG PSR-11)
psr/event-dispatcher                       1.0.0       Standard interfaces for event handling.
psr/http-client                            1.0.1       Common interface for HTTP clients
psr/http-factory                           1.0.1       Common interfaces for PSR-7 HTTP message factories
psr/http-message                           1.0.1       Common interface for HTTP messages
psr/log                                    1.1.4       Common interface for logging libraries
ralouphie/getallheaders                    3.0.3       A polyfill for getallheaders.
ramsey/collection                          1.2.2       A PHP library for representing and manipulating collections.
ramsey/uuid                                4.2.3       A PHP library for generating and working with universally unique identifiers (UUIDs).
ramsey/uuid-doctrine                       1.8.1       Use ramsey/uuid as a Doctrine field type.
sabberworm/php-css-parser                  8.4.0       Parser for CSS Files written in PHP
sebastian/cli-parser                       1.0.1       Library for parsing CLI options
sebastian/code-unit                        1.0.8       Collection of value objects that represent the PHP code units
sebastian/code-unit-reverse-lookup         2.0.3       Looks up which function or method a line of code belongs to
sebastian/comparator                       4.0.6       Provides the functionality to compare PHP values for equality
sebastian/complexity                       2.0.2       Library for calculating the complexity of PHP code units
sebastian/diff                             4.0.4       Diff implementation
sebastian/environment                      5.1.3       Provides functionality to handle HHVM/PHP environments
sebastian/exporter                         4.0.4       Provides the functionality to export PHP variables for visualization
sebastian/global-state                     5.0.5       Snapshotting of global state
sebastian/lines-of-code                    1.0.3       Library for counting the lines of code in PHP source code
sebastian/object-enumerator                4.0.4       Traverses array structures and object graphs to enumerate all referenced objects
sebastian/object-reflector                 2.0.4       Allows reflection of object attributes, including inherited and non-public ones
sebastian/recursion-context                4.0.4       Provides functionality to recursively process PHP variables
sebastian/resource-operations              3.0.3       Provides a list of PHP built-in functions that operate on resources
sebastian/type                             2.3.4       Collection of value objects that represent the types of the PHP type system
sebastian/version                          3.0.2       Library that helps with managing the version number of Git-hosted PHP projects
sensio/framework-extra-bundle              v6.2.6      This bundle provides a way to configure your controllers with annotations
sentry/sdk                                 3.1.1       This is a metapackage shipping sentry/sentry with a recommended HTTP client.
sentry/sentry                              3.3.7       A PHP SDK for Sentry (http://sentry.io)
sentry/sentry-symfony                      4.2.6       Symfony integration for Sentry (http://getsentry.com)
smalot/pdfparser                           v2.1.0      Pdf parser library. Can read and extract information from pdf file.
smsapi/php-client                          v3.0.4      SMSAPI API PHP Client
symfony/amqp-messenger                     v5.4.3      Symfony AMQP extension Messenger Bridge
symfony/asset                              v5.4.3      Manages URL generation and versioning of web assets such as CSS stylesheets, JavaScript files and image files
symfony/browser-kit                        v5.4.3      Simulates the behavior of a web browser, allowing you to make requests, click on links and submit forms program...
symfony/cache                              v5.4.3      Provides an extended PSR-6, PSR-16 (and tags) implementation
symfony/cache-contracts                    v2.5.0      Generic abstractions related to caching
symfony/config                             v5.4.3      Helps you find, load, combine, autofill and validate configuration values of any kind
symfony/console                            v5.4.3      Eases the creation of beautiful and testable command line interfaces
symfony/dependency-injection               v5.4.3      Allows you to standardize and centralize the way objects are constructed in your application
symfony/deprecation-contracts              v3.0.0      A generic function and convention to trigger deprecation notices
symfony/doctrine-bridge                    v5.4.3      Provides integration for Doctrine with various Symfony components
symfony/doctrine-messenger                 v5.4.3      Symfony Doctrine Messenger Bridge
symfony/dom-crawler                        v5.4.3      Eases DOM navigation for HTML and XML documents
symfony/dotenv                             v5.4.3      Registers environment variables from a .env file
symfony/error-handler                      v5.4.3      Provides tools to manage errors and ease debugging PHP code
symfony/event-dispatcher                   v5.4.3      Provides tools that allow your application components to communicate with each other by dispatching events and ...
symfony/event-dispatcher-contracts         v3.0.0      Generic abstractions related to dispatching event
symfony/expression-language                v5.4.3      Provides an engine that can compile and evaluate expressions
symfony/filesystem                         v5.4.3      Provides basic utilities for the filesystem
symfony/finder                             v5.4.3      Finds files and directories via an intuitive fluent interface
symfony/flex                               v1.18.5     Composer plugin for Symfony
symfony/framework-bundle                   v5.4.4      Provides a tight integration between Symfony components and the Symfony full-stack framework
symfony/http-client                        v5.4.3      Provides powerful methods to fetch HTTP resources synchronously or asynchronously
symfony/http-client-contracts              v2.5.0      Generic abstractions related to HTTP clients
symfony/http-foundation                    v5.4.3      Defines an object-oriented layer for the HTTP specification
symfony/http-kernel                        v5.4.4      Provides a structured process for converting a Request into a Response
symfony/mailer                             v5.4.3      Helps sending emails
symfony/maker-bundle                       v1.37.0     Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget abou...
symfony/messenger                          v5.4.3      Helps applications send and receive messages to/from other applications or via message queues
symfony/mime                               v5.4.3      Allows manipulating MIME messages
symfony/monolog-bridge                     v5.4.3      Provides integration for Monolog with various Symfony components
symfony/monolog-bundle                     v3.7.1      Symfony MonologBundle
symfony/options-resolver                   v5.4.3      Provides an improved replacement for the array_replace PHP function
symfony/password-hasher                    v5.4.3      Provides password hashing utilities
symfony/phpunit-bridge                     v5.4.3      Provides utilities for PHPUnit, especially user deprecation notices management
symfony/polyfill-intl-grapheme             v1.24.0     Symfony polyfill for intl's grapheme_* functions
symfony/polyfill-intl-idn                  v1.24.0     Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions
symfony/polyfill-intl-normalizer           v1.24.0     Symfony polyfill for intl's Normalizer class and related functions
symfony/polyfill-mbstring                  v1.24.0     Symfony polyfill for the Mbstring extension
symfony/polyfill-php73                     v1.24.0     Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions
symfony/polyfill-php80                     v1.24.0     Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions
symfony/polyfill-php81                     v1.24.0     Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions
symfony/polyfill-uuid                      v1.24.0     Symfony polyfill for uuid functions
symfony/property-access                    v5.4.3      Provides functions to read and write from/to an object or array using a simple string notation
symfony/property-info                      v5.4.3      Extracts information about PHP class' properties using metadata of popular sources
symfony/proxy-manager-bridge               v5.4.3      Provides integration for ProxyManager with various Symfony components
symfony/psr-http-message-bridge            v2.1.2      PSR HTTP message bridge
symfony/redis-messenger                    v5.4.3      Symfony Redis extension Messenger Bridge
symfony/requirements-checker               v2.0.1      Check Symfony requirements and give recommendations
symfony/routing                            v5.4.3      Maps an HTTP request to a set of configuration variables
symfony/security-bundle                    v5.4.3      Provides a tight integration of the Security component into the Symfony full-stack framework
symfony/security-core                      v5.4.3      Symfony Security Component - Core Library
symfony/security-csrf                      v5.4.3      Symfony Security Component - CSRF Library
symfony/security-guard                     v5.4.3      Symfony Security Component - Guard
symfony/security-http                      v5.4.3      Symfony Security Component - HTTP Integration
symfony/serializer                         v5.4.3      Handles serializing and deserializing data structures, including object graphs, into array structures or other ...
symfony/service-contracts                  v2.4.1      Generic abstractions related to writing services
symfony/stopwatch                          v5.4.3      Provides a way to profile code
symfony/string                             v5.4.3      Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a u...
symfony/translation                        v5.4.3      Provides tools to internationalize your application
symfony/translation-contracts              v2.5.0      Generic abstractions related to translation
symfony/twig-bridge                        v5.4.3      Provides integration for Twig with various Symfony components
symfony/twig-bundle                        v5.4.3      Provides a tight integration of Twig into the Symfony full-stack framework
symfony/validator                          v5.4.3      Provides tools to validate values
symfony/var-dumper                         v5.4.3      Provides mechanisms for walking through any arbitrary PHP variable
symfony/var-exporter                       v5.4.3      Allows exporting any serializable PHP data structure to plain PHP code
symfony/web-profiler-bundle                v5.4.3      Provides a development tool that gives detailed information about the execution of any request
symfony/workflow                           v5.4.3      Provides tools for managing a workflow or finite state machine
symfony/yaml                               v5.4.3      Loads and dumps YAML files
theseer/tokenizer                          1.2.1       A small library for converting tokenized PHP source code into XML and potentially other formats
twig/extra-bundle                          v3.3.8      A Symfony bundle for extra Twig extensions
twig/twig                                  v3.3.8      Twig, the flexible, fast, and secure template language for PHP
webmozart/assert                           1.10.0      Assertions to validate method input/output with nice error messages.
webonyx/graphql-php                        v0.13.9     A PHP port of GraphQL reference implementation
zircote/swagger-php                        2.1.0       Swagger-PHP - Generate interactive documentation for your RESTful API using phpdoc annotations

Current behavior

An exception is thrown when using code coverage mode.

How to reproduce

Run tests with --coverage-text option.

Expected behavior

No exception :)

sebastianbergmann commented 2 years ago

I cannot reproduce the issue you describe:

$ ./vendor/bin/phpunit --coverage-text               
PHPUnit 9.5.14 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.1.3 with PCOV 1.0.11
Configuration: /usr/local/src/php-code-coverage/phpunit.xml

.........SSSSSSSSSSSSSSSSSSSSSSSSSSSSS.........................  63 / 132 ( 47%)
............................................................... 126 / 132 ( 95%)
......                                                          132 / 132 (100%)

Time: 00:00.355, Memory: 38.00 MB

There were 29 skipped tests:

1) SebastianBergmann\CodeCoverage\Driver\PhpdbgDriverTest::testDoesNotSupportBranchAndPathCoverage
This test requires the PHPDBG commandline interpreter

/usr/local/src/php-code-coverage/tests/tests/Driver/PhpdbgDriverTest.php:22

2) SebastianBergmann\CodeCoverage\Driver\PhpdbgDriverTest::testBranchAndPathCoverageCanBeDisabled
This test requires the PHPDBG commandline interpreter

/usr/local/src/php-code-coverage/tests/tests/Driver/PhpdbgDriverTest.php:22

3) SebastianBergmann\CodeCoverage\Driver\PhpdbgDriverTest::testBranchAndPathCoverageCannotBeEnabled
This test requires the PHPDBG commandline interpreter

/usr/local/src/php-code-coverage/tests/tests/Driver/PhpdbgDriverTest.php:22

4) SebastianBergmann\CodeCoverage\Driver\PhpdbgDriverTest::testBranchAndPathCoverageIsNotCollected
This test requires the PHPDBG commandline interpreter

/usr/local/src/php-code-coverage/tests/tests/Driver/PhpdbgDriverTest.php:22

5) SebastianBergmann\CodeCoverage\Driver\PhpdbgDriverTest::testDoesNotSupportDeadCodeDetection
This test requires the PHPDBG commandline interpreter

/usr/local/src/php-code-coverage/tests/tests/Driver/PhpdbgDriverTest.php:22

6) SebastianBergmann\CodeCoverage\Driver\PhpdbgDriverTest::testDeadCodeDetectionCanBeDisabled
This test requires the PHPDBG commandline interpreter

/usr/local/src/php-code-coverage/tests/tests/Driver/PhpdbgDriverTest.php:22

7) SebastianBergmann\CodeCoverage\Driver\PhpdbgDriverTest::testDeadCodeDetectionCannotBeEnabled
This test requires the PHPDBG commandline interpreter

/usr/local/src/php-code-coverage/tests/tests/Driver/PhpdbgDriverTest.php:22

8) SebastianBergmann\CodeCoverage\Driver\PhpdbgDriverTest::testDeadCodeIsNotDetected
This test requires the PHPDBG commandline interpreter

/usr/local/src/php-code-coverage/tests/tests/Driver/PhpdbgDriverTest.php:22

9) SebastianBergmann\CodeCoverage\Driver\PhpdbgDriverTest::testHasNameAndVersion
This test requires the PHPDBG commandline interpreter

/usr/local/src/php-code-coverage/tests/tests/Driver/PhpdbgDriverTest.php:22

10) SebastianBergmann\CodeCoverage\Driver\Xdebug2DriverTest::testSupportsBranchAndPathCoverage
This test requires the Xdebug extension to be loaded

/usr/local/src/php-code-coverage/tests/tests/Driver/Xdebug2DriverTest.php:31

11) SebastianBergmann\CodeCoverage\Driver\Xdebug2DriverTest::testBranchAndPathCoverageCanBeDisabled
This test requires the Xdebug extension to be loaded

/usr/local/src/php-code-coverage/tests/tests/Driver/Xdebug2DriverTest.php:31

12) SebastianBergmann\CodeCoverage\Driver\Xdebug2DriverTest::testBranchAndPathCoverageCanBeEnabled
This test requires the Xdebug extension to be loaded

/usr/local/src/php-code-coverage/tests/tests/Driver/Xdebug2DriverTest.php:31

13) SebastianBergmann\CodeCoverage\Driver\Xdebug2DriverTest::testBranchAndPathCoverageIsNotCollectedByDefault
This test requires the Xdebug extension to be loaded

/usr/local/src/php-code-coverage/tests/tests/Driver/Xdebug2DriverTest.php:31

14) SebastianBergmann\CodeCoverage\Driver\Xdebug2DriverTest::testSupportsDeadCodeDetection
This test requires the Xdebug extension to be loaded

/usr/local/src/php-code-coverage/tests/tests/Driver/Xdebug2DriverTest.php:31

15) SebastianBergmann\CodeCoverage\Driver\Xdebug2DriverTest::testDeadCodeDetectionCanBeDisabled
This test requires the Xdebug extension to be loaded

/usr/local/src/php-code-coverage/tests/tests/Driver/Xdebug2DriverTest.php:31

16) SebastianBergmann\CodeCoverage\Driver\Xdebug2DriverTest::testDeadCodeDetectionCanBeEnabled
This test requires the Xdebug extension to be loaded

/usr/local/src/php-code-coverage/tests/tests/Driver/Xdebug2DriverTest.php:31

17) SebastianBergmann\CodeCoverage\Driver\Xdebug2DriverTest::testDeadCodeIsNotDetectedByDefault
This test requires the Xdebug extension to be loaded

/usr/local/src/php-code-coverage/tests/tests/Driver/Xdebug2DriverTest.php:31

18) SebastianBergmann\CodeCoverage\Driver\Xdebug2DriverTest::testHasNameAndVersion
This test requires the Xdebug extension to be loaded

/usr/local/src/php-code-coverage/tests/tests/Driver/Xdebug2DriverTest.php:31

19) SebastianBergmann\CodeCoverage\Driver\Xdebug2DriverTest::testFilterWorks
This test requires the Xdebug extension to be loaded

/usr/local/src/php-code-coverage/tests/tests/Driver/Xdebug2DriverTest.php:31

20) SebastianBergmann\CodeCoverage\Driver\Xdebug3DriverTest::testSupportsBranchAndPathCoverage
This test requires the Xdebug extension to be loaded

/usr/local/src/php-code-coverage/tests/tests/Driver/Xdebug3DriverTest.php:31

21) SebastianBergmann\CodeCoverage\Driver\Xdebug3DriverTest::testBranchAndPathCoverageCanBeDisabled
This test requires the Xdebug extension to be loaded

/usr/local/src/php-code-coverage/tests/tests/Driver/Xdebug3DriverTest.php:31

22) SebastianBergmann\CodeCoverage\Driver\Xdebug3DriverTest::testBranchAndPathCoverageCanBeEnabled
This test requires the Xdebug extension to be loaded

/usr/local/src/php-code-coverage/tests/tests/Driver/Xdebug3DriverTest.php:31

23) SebastianBergmann\CodeCoverage\Driver\Xdebug3DriverTest::testBranchAndPathCoverageIsNotCollectedByDefault
This test requires the Xdebug extension to be loaded

/usr/local/src/php-code-coverage/tests/tests/Driver/Xdebug3DriverTest.php:31

24) SebastianBergmann\CodeCoverage\Driver\Xdebug3DriverTest::testSupportsDeadCodeDetection
This test requires the Xdebug extension to be loaded

/usr/local/src/php-code-coverage/tests/tests/Driver/Xdebug3DriverTest.php:31

25) SebastianBergmann\CodeCoverage\Driver\Xdebug3DriverTest::testDeadCodeDetectionCanBeDisabled
This test requires the Xdebug extension to be loaded

/usr/local/src/php-code-coverage/tests/tests/Driver/Xdebug3DriverTest.php:31

26) SebastianBergmann\CodeCoverage\Driver\Xdebug3DriverTest::testDeadCodeDetectionCanBeEnabled
This test requires the Xdebug extension to be loaded

/usr/local/src/php-code-coverage/tests/tests/Driver/Xdebug3DriverTest.php:31

27) SebastianBergmann\CodeCoverage\Driver\Xdebug3DriverTest::testDeadCodeIsNotDetectedByDefault
This test requires the Xdebug extension to be loaded

/usr/local/src/php-code-coverage/tests/tests/Driver/Xdebug3DriverTest.php:31

28) SebastianBergmann\CodeCoverage\Driver\Xdebug3DriverTest::testHasNameAndVersion
This test requires the Xdebug extension to be loaded

/usr/local/src/php-code-coverage/tests/tests/Driver/Xdebug3DriverTest.php:31

29) SebastianBergmann\CodeCoverage\Driver\Xdebug3DriverTest::testFilterWorks
This test requires the Xdebug extension to be loaded

/usr/local/src/php-code-coverage/tests/tests/Driver/Xdebug3DriverTest.php:31

OK, but incomplete, skipped, or risky tests!
Tests: 132, Assertions: 270, Skipped: 29.

Code Coverage Report:        
  2022-02-18 16:13:10        

 Summary:                    
  Classes: 20.69% (12/58)    
  Methods: 66.31% (250/377)  
  Lines:   84.92% (2607/3070)

SebastianBergmann\CodeCoverage\BranchAndPathCoverageNotSupportedException
  Methods:  ( 0/ 0)   Lines:  (  0/  0)
SebastianBergmann\CodeCoverage\CodeCoverage
  Methods:  24.39% (10/41)   Lines:  50.54% ( 94/186)
SebastianBergmann\CodeCoverage\CrapIndex
  Methods:  66.67% ( 2/ 3)   Lines:  88.89% (  8/  9)
SebastianBergmann\CodeCoverage\DeadCodeDetectionNotSupportedException
  Methods:  ( 0/ 0)   Lines:  (  0/  0)
SebastianBergmann\CodeCoverage\Directory
  Methods:   0.00% ( 0/ 1)   Lines:  50.00% (  2/  4)
SebastianBergmann\CodeCoverage\DirectoryCouldNotBeCreatedException
  Methods:  ( 0/ 0)   Lines:  (  0/  0)
SebastianBergmann\CodeCoverage\Driver\Driver
  Methods:  60.00% ( 6/10)   Lines:  77.78% ( 14/ 18)
SebastianBergmann\CodeCoverage\Driver\PathExistsButIsNotDirectoryException
  Methods:   0.00% ( 0/ 1)   Lines:   0.00% (  0/  1)
SebastianBergmann\CodeCoverage\Driver\PcovDriver
  Methods:  25.00% ( 1/ 4)   Lines:  28.57% (  4/ 14)
SebastianBergmann\CodeCoverage\Driver\PcovNotAvailableException
  Methods:   0.00% ( 0/ 1)   Lines:   0.00% (  0/  1)
SebastianBergmann\CodeCoverage\Driver\PhpdbgDriver
  Methods:   0.00% ( 0/ 5)   Lines:   0.00% (  0/ 22)
SebastianBergmann\CodeCoverage\Driver\PhpdbgNotAvailableException
  Methods:   0.00% ( 0/ 1)   Lines:   0.00% (  0/  1)
SebastianBergmann\CodeCoverage\Driver\Selector
  Methods:   0.00% ( 0/ 2)   Lines:   0.00% (  0/ 20)
SebastianBergmann\CodeCoverage\Driver\WriteOperationFailedException
  Methods:   0.00% ( 0/ 1)   Lines:   0.00% (  0/  1)
SebastianBergmann\CodeCoverage\Driver\WrongXdebugVersionException
  Methods:  ( 0/ 0)   Lines:  (  0/  0)
SebastianBergmann\CodeCoverage\Driver\Xdebug2Driver
  Methods:   0.00% ( 0/ 6)   Lines:   0.00% (  0/ 31)
SebastianBergmann\CodeCoverage\Driver\Xdebug2NotEnabledException
  Methods:   0.00% ( 0/ 1)   Lines:   0.00% (  0/  1)
SebastianBergmann\CodeCoverage\Driver\Xdebug3Driver
  Methods:   0.00% ( 0/ 6)   Lines:   0.00% (  0/ 29)
SebastianBergmann\CodeCoverage\Driver\Xdebug3NotEnabledException
  Methods:   0.00% ( 0/ 1)   Lines:   0.00% (  0/  1)
SebastianBergmann\CodeCoverage\Driver\XdebugNotAvailableException
  Methods:   0.00% ( 0/ 1)   Lines:   0.00% (  0/  1)
SebastianBergmann\CodeCoverage\Filter
  Methods:  88.89% ( 8/ 9)   Lines:  97.06% ( 33/ 34)
SebastianBergmann\CodeCoverage\InvalidArgumentException
  Methods:  ( 0/ 0)   Lines:  (  0/  0)
SebastianBergmann\CodeCoverage\NoCodeCoverageDriverAvailableException
  Methods:   0.00% ( 0/ 1)   Lines:   0.00% (  0/  1)
SebastianBergmann\CodeCoverage\NoCodeCoverageDriverWithPathCoverageSupportAvailableException
  Methods:   0.00% ( 0/ 1)   Lines:   0.00% (  0/  1)
SebastianBergmann\CodeCoverage\Node\AbstractNode
  Methods:  85.00% (17/20)   Lines:  87.93% ( 51/ 58)
SebastianBergmann\CodeCoverage\Node\Builder
  Methods:  80.00% ( 4/ 5)   Lines:  97.30% ( 72/ 74)
SebastianBergmann\CodeCoverage\Node\Directory
  Methods:  92.00% (23/25)   Lines:  92.31% (108/117)
SebastianBergmann\CodeCoverage\Node\File
  Methods:  75.00% (21/28)   Lines:  78.41% (207/264)
SebastianBergmann\CodeCoverage\Node\Iterator
  Methods:  75.00% ( 6/ 8)   Lines:  75.00% (  6/  8)
SebastianBergmann\CodeCoverage\ParserException
  Methods:  ( 0/ 0)   Lines:  (  0/  0)
SebastianBergmann\CodeCoverage\Percentage
  Methods: 100.00% ( 5/ 5)   Lines: 100.00% ( 12/ 12)
SebastianBergmann\CodeCoverage\ProcessedCodeCoverageData
  Methods: 100.00% (12/12)   Lines: 100.00% ( 82/ 82)
SebastianBergmann\CodeCoverage\RawCodeCoverageData
  Methods:  85.71% (12/14)   Lines:  97.01% ( 65/ 67)
SebastianBergmann\CodeCoverage\ReflectionException
  Methods:  ( 0/ 0)   Lines:  (  0/  0)
SebastianBergmann\CodeCoverage\ReportAlreadyFinalizedException
  Methods:   0.00% ( 0/ 1)   Lines:   0.00% (  0/  1)
SebastianBergmann\CodeCoverage\Report\Clover
  Methods:   0.00% ( 0/ 1)   Lines:  83.80% (119/142)
SebastianBergmann\CodeCoverage\Report\Cobertura
  Methods:   0.00% ( 0/ 1)   Lines:  97.09% (167/172)
SebastianBergmann\CodeCoverage\Report\Crap4j
  Methods:  50.00% ( 2/ 4)   Lines:  88.06% ( 59/ 67)
SebastianBergmann\CodeCoverage\Report\Html\Dashboard
  Methods:  83.33% ( 5/ 6)   Lines:  96.15% (100/104)
SebastianBergmann\CodeCoverage\Report\Html\Directory
  Methods:   0.00% ( 0/ 2)   Lines:  90.74% ( 49/ 54)
SebastianBergmann\CodeCoverage\Report\Html\Facade
  Methods:  75.00% ( 3/ 4)   Lines:  94.74% ( 54/ 57)
SebastianBergmann\CodeCoverage\Report\Html\File
  Methods:  52.38% (11/21)   Lines:  93.31% (460/493)
SebastianBergmann\CodeCoverage\Report\Html\Renderer
  Methods:  90.00% ( 9/10)   Lines:  99.28% (137/138)
SebastianBergmann\CodeCoverage\Report\PHP
  Methods:   0.00% ( 0/ 1)   Lines:  85.71% (  6/  7)
SebastianBergmann\CodeCoverage\Report\Text
  Methods:  60.00% ( 3/ 5)   Lines:  79.87% (119/149)
SebastianBergmann\CodeCoverage\Report\Xml\BuildInformation
  Methods:  80.00% ( 4/ 5)   Lines:  84.62% ( 22/ 26)
SebastianBergmann\CodeCoverage\Report\Xml\Coverage
  Methods:  66.67% ( 2/ 3)   Lines:  93.75% ( 15/ 16)
SebastianBergmann\CodeCoverage\Report\Xml\Directory
  Methods:  ( 0/ 0)   Lines:  (  0/  0)
SebastianBergmann\CodeCoverage\Report\Xml\Facade
  Methods:  69.23% ( 9/13)   Lines:  91.30% (105/115)
SebastianBergmann\CodeCoverage\Report\Xml\File
  Methods: 100.00% ( 5/ 5)   Lines: 100.00% ( 25/ 25)
SebastianBergmann\CodeCoverage\Report\Xml\Method
  Methods: 100.00% ( 6/ 6)   Lines: 100.00% ( 11/ 11)
SebastianBergmann\CodeCoverage\Report\Xml\Node
  Methods: 100.00% ( 7/ 7)   Lines: 100.00% ( 25/ 25)
SebastianBergmann\CodeCoverage\Report\Xml\Project
  Methods:  85.71% ( 6/ 7)   Lines:  87.50% ( 28/ 32)
SebastianBergmann\CodeCoverage\Report\Xml\Report
  Methods:  87.50% ( 7/ 8)   Lines:  96.88% ( 31/ 32)
SebastianBergmann\CodeCoverage\Report\Xml\Source
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% (  6/  6)
SebastianBergmann\CodeCoverage\Report\Xml\Tests
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% (  9/  9)
SebastianBergmann\CodeCoverage\Report\Xml\Totals
  Methods:  85.71% ( 6/ 7)   Lines:  98.04% ( 50/ 51)
SebastianBergmann\CodeCoverage\Report\Xml\Unit
  Methods: 100.00% ( 6/ 6)   Lines: 100.00% ( 22/ 22)
SebastianBergmann\CodeCoverage\StaticAnalysisCacheNotConfiguredException
  Methods:  ( 0/ 0)   Lines:  (  0/  0)
SebastianBergmann\CodeCoverage\StaticAnalysis\CacheWarmer
  Methods:   0.00% ( 0/ 1)   Lines:   0.00% (  0/  4)
SebastianBergmann\CodeCoverage\StaticAnalysis\CodeUnitFindingVisitor
  Methods:  57.14% ( 8/14)   Lines:  83.90% ( 99/118)
SebastianBergmann\CodeCoverage\StaticAnalysis\ExecutableLinesFindingVisitor
  Methods: 100.00% ( 5/ 5)   Lines: 100.00% ( 22/ 22)
SebastianBergmann\CodeCoverage\StaticAnalysis\IgnoredLinesFindingVisitor
  Methods:  66.67% ( 2/ 3)   Lines:  83.33% ( 20/ 24)
SebastianBergmann\CodeCoverage\StaticAnalysis\ParsingFileAnalyser
  Methods: 100.00% ( 9/ 9)   Lines: 100.00% ( 79/ 79)
SebastianBergmann\CodeCoverage\TestIdMissingException
  Methods:   0.00% ( 0/ 1)   Lines:   0.00% (  0/  1)
SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% (  7/  7)
SebastianBergmann\CodeCoverage\Version
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  3/  3)
SebastianBergmann\CodeCoverage\XmlException
  Methods:  ( 0/ 0)   Lines:  (  0/  0)
sebastianbergmann commented 2 years ago

Thank you for your report.

Please provide a minimal, self-contained, reproducing test case that shows the problem you are reporting.

Without such a minimal, self-contained, reproducing test case I will not be able to investigate this issue.

deoomen commented 2 years ago

I'll try later to attach some code that can reproduce this. But for now I think it's probably connected with php-code-coverage version 9.2.11. Seems to be little strange...

fattybenji commented 2 years ago

Same problem here, php 7.4.24 with PCOV 1.0.9. The problem appeared because of an automatic update with the symfony bridge. It worked when we downgraded php-code-coverage to version 9.2.10 using SYMFONY_PHPUNIT_REQUIRE.

Since deoomen also seems to use symfony, there might be some voodoo interaction there.

sebastianbergmann commented 2 years ago

On principle, I do not debug issues when Symfony's PHPUnit bridge is involved. Please provide a minimal, self-contained, reproducing test case that shows the problem you are reporting and does not involve third-party code such as Symfony's PHPUnit bridge.

varrol commented 2 years ago

This seems to be related to the Symfony PHPUnit bridge. To fix you can add: <server name="SYMFONY_PHPUNIT_REQUIRE" value="phpunit/php-code-coverage:9.2.10" /> into your phpunit.xml.dist

sebastianbergmann commented 2 years ago

@nicolas-grekas Do you have an idea what might be going on here? Thanks!

nicolas-grekas commented 2 years ago

Doesn't inspire me anything but I can have a look. Could anyone affected provide me with a simple repository I could clone locally to run and debug this?

alshenetsky commented 2 years ago

Very same issue. Thank you @varrol for finding a workaround.

p.s. Hope that an official fix (whether it's on the phpunit side or the symfony side) will follow soon.

andreasganje commented 2 years ago

the same issue here. workaround from @varrol works fine.

maybe it is helpful for debugging, the issue appears for me when i skip the tests folder name (as already multiple folders are defined in phpunit.xml.dist) within the cmd call:

works without the workaround - but ignores the additional paths given in the xml: "... --colors=never --configuration phpunit.xml.dist tests"

results in the named issue (the workaround helps here): "... --colors=never --configuration phpunit.xml.dist "

r3wald commented 2 years ago

My error message is a little bit more verbose: Generating code coverage report in Cobertura XML format ... SebastianBergmann\CodeCoverage\Node\Builder::__construct(): Argument #1 ($coveredFileAnalyser) must be of type SebastianBergmann\CodeCoverage\StaticAnalysis\CoveredFileAnalyser, SebastianBergmann\CodeCoverage\StaticAnalysis\ParsingFileAnalyser given, called in /builds/emtec/itm/itm-backend/vendor/bin/.phpunit/phpunit-9.5-0/vendor/phpunit/php-code-coverage/src/CodeCoverage.php on line 131

That matches the changelog: https://github.com/sebastianbergmann/php-code-coverage/blob/master/ChangeLog.md#changed-3

Switching back to 9.2.10 works.

sebastianbergmann commented 2 years ago

The string CoveredFileAnalyser does not exist in that version of php-code-coverage's codebase.

nicolas-grekas commented 2 years ago

Looks like this comes from https://github.com/symfony/symfony/issues/45542

sebastianbergmann commented 2 years ago

Thank you, Nicolas. I will close this ticket then.