Skip to content

Coverage PHP 8 constructor property promotion not covered #843

@frankvanhest

Description

@frankvanhest

When running phpunit 9.5 with --coverage-html or --coverage-text in PHP 8, a constructor with property promotion is marked as not covered as shown in the image below.

Screenshot 2021-01-14 at 10 52 49

But when it is run with --coverage-clover using PhpStorm, the code is marked as covered.

Screenshot 2021-01-14 at 10 54 08

Am I missing something configuration wise?
If you need information I'll be happy to provide it.

[Update]
Used versions:

  • PHP: 8.0.0
  • PHP Code Coverage: 9.2.5
  • Xdebug: 3.0.1
  • PHPUnit: 9.5.0

Output php -v:

PHP 8.0.0 (cli) (built: Nov 27 2020 12:26:05) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.0-dev, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.0, Copyright (c), by Zend Technologies
    with Xdebug v3.0.1, Copyright (c) 2002-2020, by Derick Rethans

Tar archive to reproduce the case:
issue.tar.gz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions