MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001413XdebugCode Coveragepublic2017-04-08 12:232017-04-16 01:17
Reporterolvlvl 
Assigned Toderick 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformMacOSMacOSOS Version10.12.03
Product Version2.5.1 
Target VersionFixed in Version2.5.2 
Summary0001413: Line is missing from code coverage
DescriptionI have two classes that are almost identical: Require and Require2. The first one inherits a constant from an interface, the second defines the constant. The line using the inherited constant appears as not covered, while the other one does:

    public function normalize_params(array $params)
    {
        return array_merge([

            self::OPTION_STOP_ON_ERROR => true

        ], $params);
    }
Steps To ReproduceRun the following command with the attached files:

    phpunit --coverage-html build/coverage

Now check build/coverage/Required.php.html#16, the line appears as "Not executed", while build/coverage/Required2.php.html#16 is fine.
Additional InformationWith OpCache disabled the line appears as "Not executed" in both classes.

PHP was installed with "brew".
TagsNo tags attached.
Operating SystemMacOS
PHP Version7.1.0-7.1.4
Attached Fileszip file icon xdebug-bug-1.zip [^] (11,566 bytes) 2017-04-08 12:23

- Relationships

-  Notes
(0004259)
derick (administrator)
2017-04-13 18:47

I tried reproducing this, but I can't. In both situations (opcache on, or off), both lines "16" in Required.php and Required2.php are marked as executable.

Can you please show the output of:

phpunit --version
php -v
php -m

cheers,
Derick
(0004260)
olvlvl (reporter)
2017-04-14 00:46

Here:

PHPUnit 5.7.9 by Sebastian Bergmann and contributors.

PHP 7.1.3 (cli) (built: Mar 28 2017 21:57:28) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.1.3, Copyright (c) 1999-2017, by Zend Technologies
    with Xdebug v2.5.1, Copyright (c) 2002-2017, by Derick Rethans

[PHP Modules]
apcu
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
ldap
libxml
mbstring
mysqli
mysqlnd
odbc
openssl
pcntl
pcre
PDO
pdo_mysql
PDO_ODBC
pdo_sqlite
Phar
posix
readline
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xdebug
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Xdebug
Zend OPcache
(0004263)
derick (administrator)
2017-04-15 15:48

OK. With PHP 7.1.3 I can reproduce this. With 7.1.4, I can not. It looks like PHP itself changed something. I am suspecting it is the fix for bug #69676 (https://bugs.php.net/bug.php?id=69676 [^]). This fix, seems to have caused some line numbers to go wrong. I can fix the symptom in Xdebug, but there is something more going wrong in PHP too I believe.
(0004264)
derick (administrator)
2017-04-16 00:28

Fixed for 2.5.2.

And thanks for the excellent report!
(0004265)
olvlvl (reporter)
2017-04-16 01:17

GTK there's already a fix. Thanks for your excellent work.

- Issue History
Date Modified Username Field Change
2017-04-08 12:23 olvlvl New Issue
2017-04-08 12:23 olvlvl File Added: xdebug-bug-1.zip
2017-04-13 18:47 derick Note Added: 0004259
2017-04-13 18:47 derick Assigned To => derick
2017-04-13 18:47 derick Status new => feedback
2017-04-14 00:46 olvlvl Note Added: 0004260
2017-04-14 00:46 olvlvl Status feedback => assigned
2017-04-15 15:48 derick Note Added: 0004263
2017-04-16 00:28 derick Note Added: 0004264
2017-04-16 00:28 derick Status assigned => closed
2017-04-16 00:28 derick Resolution open => fixed
2017-04-16 00:28 derick Fixed in Version => 2.5.2
2017-04-16 01:17 olvlvl Note Added: 0004265


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker