Skip to content

Commit 1fc627a

Browse files
committed
use SKIPIF to check if opcache is enabled
1 parent 8800532 commit 1fc627a

File tree

4 files changed

+28
-16
lines changed

4 files changed

+28
-16
lines changed

Zend/tests/repeated_include/anonymous_class_in_closure.phpt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
--TEST--
22
Repeated include must not increase memory - anonymous class
3-
--EXTENSIONS--
4-
opcache
5-
--FILE--
3+
--SKIPIF--
64
<?php
7-
85
// TODO test should pass even without opcache, but fixes are needed
96
// related bug tracker https://bugs.php.net/bug.php?id=76982
7+
if (!extension_loaded('Zend OPcache') || !ini_get('opcache.enable') || !ini_get('opcache.enable_cli')) {
8+
die('Test currently requires opcache enabled');
9+
}
10+
?>
11+
--FILE--
12+
<?php
1013

1114
// also, new anonymous class included multiple times always get a new class name,
1215
// this test accounts for that and tests if anonymous class declared in a closure,

Zend/tests/repeated_include/anonymous_function.phpt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
--TEST--
22
Repeated include must not increase memory - anonymous function
3-
--EXTENSIONS--
4-
opcache
5-
--FILE--
3+
--SKIPIF--
64
<?php
7-
85
// TODO test should pass even without opcache, but fixes are needed
96
// related bug tracker https://bugs.php.net/bug.php?id=76982
7+
if (!extension_loaded('Zend OPcache') || !ini_get('opcache.enable') || !ini_get('opcache.enable_cli')) {
8+
die('Test currently requires opcache enabled');
9+
}
10+
?>
11+
--FILE--
12+
<?php
1013

1114
$m = -1;
1215
$mDiff = -1;

Zend/tests/repeated_include/class_declaration_in_if.phpt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
--TEST--
22
Repeated include must not increase memory - class in if condition
3-
--EXTENSIONS--
4-
opcache
5-
--FILE--
3+
--SKIPIF--
64
<?php
7-
85
// TODO test should pass even without opcache, but fixes are needed
96
// related bug tracker https://bugs.php.net/bug.php?id=76982
7+
if (!extension_loaded('Zend OPcache') || !ini_get('opcache.enable') || !ini_get('opcache.enable_cli')) {
8+
die('Test currently requires opcache enabled');
9+
}
10+
?>
11+
--FILE--
12+
<?php
1013

1114
$m = -1;
1215
$mDiff = -1;

Zend/tests/repeated_include/function_declaration_in_if.phpt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
--TEST--
22
Repeated include must not increase memory - function in if condition
3-
--EXTENSIONS--
4-
opcache
5-
--FILE--
3+
--SKIPIF--
64
<?php
7-
85
// TODO test should pass even without opcache, but fixes are needed
96
// related bug tracker https://bugs.php.net/bug.php?id=76982
7+
if (!extension_loaded('Zend OPcache') || !ini_get('opcache.enable') || !ini_get('opcache.enable_cli')) {
8+
die('Test currently requires opcache enabled');
9+
}
10+
?>
11+
--FILE--
12+
<?php
1013

1114
$m = -1;
1215
$mDiff = -1;

0 commit comments

Comments
 (0)