Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Splitting up tests due to changes in opcodes in PHP 7.2 (and opcache)
- Loading branch information
Showing
12 changed files
with
203 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
--TEST-- | ||
Test for bug #757: XDEBUG_CC_UNUSED does not work with code outside a function (>= PHP 7.2 && opcache) | ||
--SKIPIF-- | ||
<?php | ||
if ( ! ( version_compare(phpversion(), "7.2", '>=') && extension_loaded('zend opcache'))) { echo "skip >= PHP 7.2 && opcache loaded needed\n"; }; | ||
?> | ||
--INI-- | ||
xdebug.default_enable=1 | ||
xdebug.overload_var_dump=0 | ||
xdebug.auto_trace=0 | ||
xdebug.trace_options=0 | ||
xdebug.trace_output_dir=/tmp | ||
xdebug.collect_params=1 | ||
xdebug.collect_return=0 | ||
xdebug.collect_assignments=0 | ||
xdebug.auto_profile=0 | ||
xdebug.profiler_enable=0 | ||
xdebug.dump_globals=0 | ||
xdebug.show_mem_delta=0 | ||
xdebug.trace_format=0 | ||
xdebug.extended_info=1 | ||
--FILE-- | ||
<?php | ||
xdebug_start_code_coverage(XDEBUG_CC_UNUSED); | ||
|
||
function f() | ||
{ | ||
$x = 1; | ||
if ($x) { | ||
$y = 2; | ||
} else { | ||
$y = 3; | ||
} | ||
echo $y, "\n"; | ||
} | ||
|
||
f(); | ||
|
||
$cc = xdebug_get_code_coverage(); | ||
xdebug_stop_code_coverage(); | ||
var_dump($cc[__FILE__]); | ||
?> | ||
--EXPECT-- | ||
2 | ||
array(8) { | ||
[4]=> | ||
int(1) | ||
[6]=> | ||
int(1) | ||
[7]=> | ||
int(1) | ||
[8]=> | ||
int(1) | ||
[12]=> | ||
int(1) | ||
[13]=> | ||
int(1) | ||
[15]=> | ||
int(1) | ||
[17]=> | ||
int(1) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--TEST-- | ||
Test for bug #1247: xdebug.show_local_vars dumps variables with *uninitialized* values (>= PHP 7.2 && opcache) | ||
--SKIPIF-- | ||
<?php | ||
if ( ! ( version_compare(phpversion(), "7.2", '>=') && extension_loaded('zend opcache'))) { echo "skip >= PHP 7.2 && opcache loaded needed\n"; }; | ||
?> | ||
--INI-- | ||
xdebug.default_enable=1 | ||
xdebug.collect_params=4 | ||
html_errors=0 | ||
xdebug.dump.GET= | ||
xdebug.dump.POST= | ||
xdebug.show_local_vars=1 | ||
--GET-- | ||
getFoo=bar | ||
--POST-- | ||
postBar=baz | ||
--FILE-- | ||
<?php | ||
function test() | ||
{ | ||
$a = 42; | ||
strtr(); | ||
$b = 4; | ||
|
||
return $a + $b; | ||
} | ||
|
||
function testDirect() | ||
{ | ||
$c = 56; | ||
trigger_error('test'); | ||
$d = 11; | ||
|
||
return $c + $d; | ||
} | ||
|
||
test(); | ||
testDirect(); | ||
?> | ||
--EXPECTF-- | ||
Warning: strtr() expects at least 2 parameters, 0 given in %sbug01247-php72-opcache.php on line 5 | ||
|
||
Call Stack: | ||
%w%f %w%d 1. {main}() %sbug01247-php72-opcache.php:0 | ||
%w%f %w%d 2. test() %sbug01247-php72-opcache.php:20 | ||
%w%f %w%d 3. strtr() %sbug01247-php72-opcache.php:5 | ||
|
||
|
||
Notice: test in %sbug01247-php72-opcache.php on line 14 | ||
|
||
Call Stack: | ||
%w%f %w%d 1. {main}() %sbug01247-php72-opcache.php:0 | ||
%w%f %w%d 2. testDirect() %sbug01247-php72-opcache.php:21 | ||
%w%f %w%d 3. trigger_error('test') %sbug01247-php72-opcache.php:14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--TEST-- | ||
Test for bug #1270: String parsing marked not covered (>= PHP 7.2) | ||
--SKIPIF-- | ||
<?php if (!version_compare(phpversion(), "7.2", '>=')) echo "skip >= PHP 7.2 needed\n"; ?> | ||
<?php if (!extension_loaded('zend opcache')) echo "skip opcache required\n"; ?> | ||
--FILE-- | ||
<?php | ||
xdebug_start_code_coverage( XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE ); | ||
|
||
include dirname( __FILE__ ) . '/bug01270.inc'; | ||
|
||
try { func1(); } catch (Exception $e) { } | ||
try { func2(); } catch (Exception $e) { } | ||
try { func3(); } catch (Exception $e) { } | ||
|
||
$cc = xdebug_get_code_coverage(); | ||
|
||
ksort( $cc ); | ||
var_dump( array_slice( $cc, 1, 1 ) ); | ||
?> | ||
--EXPECTF-- | ||
array(1) { | ||
["%sbug01270.inc"]=> | ||
array(13) { | ||
[2]=> | ||
int(1) | ||
[4]=> | ||
int(1) | ||
[5]=> | ||
int(1) | ||
[7]=> | ||
int(1) | ||
[11]=> | ||
int(1) | ||
[13]=> | ||
int(1) | ||
[14]=> | ||
int(1) | ||
[16]=> | ||
int(1) | ||
[20]=> | ||
int(1) | ||
[22]=> | ||
int(1) | ||
[23]=> | ||
int(1) | ||
[27]=> | ||
int(1) | ||
[33]=> | ||
int(1) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters