Skip to content
Permalink
Browse files

Merged pull request #533

  • Loading branch information
derickr committed Dec 10, 2019
2 parents 81da29e + 97eaf28 commit 774b417dd6543a1a9b5707390b5af8a17bdfdf4c
Showing with 45 additions and 0 deletions.
  1. +2 −0 src/coverage/code_coverage.c
  2. +21 −0 tests/coverage/bug01728.inc
  3. +22 −0 tests/coverage/bug01728.phpt
@@ -1030,6 +1030,7 @@ void xdebug_coverage_minit(INIT_FUNC_ARGS)
XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_NEW);
XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_EXT_FCALL_BEGIN);
XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_INIT_METHOD_CALL);
XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_INIT_STATIC_METHOD_CALL);
XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_INIT_FCALL);
XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_CATCH);
XDEBUG_SET_OPCODE_OVERRIDE_COMMON(ZEND_BOOL);
@@ -1140,6 +1141,7 @@ void xdebug_coverage_mshutdown(void)
zend_set_user_opcode_handler(ZEND_NEW, NULL);
zend_set_user_opcode_handler(ZEND_EXT_FCALL_BEGIN, NULL);
zend_set_user_opcode_handler(ZEND_INIT_METHOD_CALL, NULL);
zend_set_user_opcode_handler(ZEND_INIT_STATIC_METHOD_CALL, NULL);
zend_set_user_opcode_handler(ZEND_INIT_FCALL, NULL);
zend_set_user_opcode_handler(ZEND_CATCH, NULL);
zend_set_user_opcode_handler(ZEND_BOOL, NULL);
@@ -0,0 +1,21 @@
<?php
class bar
{
public static function fc($a)
{
return self::nested(
self::nested( //this line is marked as uncovered
$a
)
);
}

private static function nested($a)
{
return $a;
}

}

echo bar::fc("test"), "\n";
?>
@@ -0,0 +1,22 @@
--TEST--
Test for bug #1728: INIT_STATIC_METHOD_FCALL is not overloaded in code coverage
--INI--
xdebug.coverage_enable=1
--FILE--
<?php
require __DIR__ . '/../utils.inc';

xdebug_start_code_coverage( XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE );

include dirname( __FILE__ ) . '/bug01728.inc';

$cc = xdebug_get_code_coverage();

ksort( $cc );
$fileInfo = array_values( array_slice( $cc, 0, 1 ) )[0];
mustBeExecuted( $fileInfo, range( 6, 7 ) );
?>
--EXPECTF--
test
line #6 is present and covered
line #7 is present and covered

0 comments on commit 774b417

Please sign in to comment.
You can’t perform that action at this time.