Skip to content

Commit 4e0dd6b

Browse files
committed
Remove unnecessary CLI checks in tests
1 parent cc60e8b commit 4e0dd6b

23 files changed

+2
-64
lines changed

Zend/tests/bug40236.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
Bug #40236 (php -a function allocation eats memory)
33
--SKIPIF--
44
<?php
5-
if (php_sapi_name() != "cli") die("skip CLI only");
65
if (extension_loaded("readline")) die("skip Test doesn't support readline");
76
?>
87
--FILE--

Zend/tests/bug60978.phpt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
--TEST--
22
Bug #60978 (exit code incorrect)
3-
--SKIPIF--
4-
<?php
5-
if ("cli" != php_sapi_name()) {
6-
echo "skip CLI only";
7-
}
8-
?>
93
--FILE--
104
<?php
115
$php = getenv('TEST_PHP_EXECUTABLE');

Zend/tests/bug66218.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
Bug #66218 zend_register_functions breaks reflection
33
--SKIPIF--
44
<?php
5-
if (PHP_SAPI != "cli") die("skip CLI only test");
65
if (!function_exists("dl")) die("skip need dl");
76
?>
87
--FILE--

Zend/tests/constant_expressions_classes.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ Constant scalar expressions with autoloading and classes
44
opcache.enable=1
55
opcache.enable_cli=1
66
opcache.optimization_level=-1
7-
--SKIPIF--
8-
<?php if (php_sapi_name() != "cli") die("skip CLI only"); ?>
97
--FILE--
108
<?php
119

ext/opcache/tests/bug66251.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ opcache.enable=1
55
opcache.enable_cli=1
66
opcache.optimization_level=-1
77
--SKIPIF--
8-
<?php if (!extension_loaded('Zend OPcache') || php_sapi_name() != "cli") die("skip CLI only"); ?>
8+
<?php if (!extension_loaded('Zend OPcache')) die("skip Zend OPcache extension not loaded"); ?>
99
--FILE--
1010
<?php
1111
printf ("A=%s\n", getA());

ext/opcache/tests/bug66338.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Bug #66338 (Optimization binding of class constants is not safely opcacheable)
33
--INI--
44
opcache.enable=0
55
--SKIPIF--
6-
<?php if (!extension_loaded('Zend OPcache') || php_sapi_name() != "cli") die("skip CLI only"); ?>
6+
<?php if (!extension_loaded('Zend OPcache')) die("skip Zend OPcache extension not loaded"); ?>
77
--FILE--
88
<?php
99
$root = str_replace('.php', "", __FILE__);

ext/opcache/tests/issue0115.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ phar.readonly=0
77
--SKIPIF--
88
<?php require_once('skipif.inc'); ?>
99
<?php if (!extension_loaded("phar")) die("skip"); ?>
10-
<?php if (php_sapi_name() != "cli") die("skip CLI only"); ?>
1110
--FILE--
1211
<?php
1312
$stub = '<?php

ext/opcache/tests/issue0140.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ opcache.revalidate_freq=0
77
opcache.file_update_protection=0
88
--SKIPIF--
99
<?php require_once('skipif.inc'); ?>
10-
<?php if (php_sapi_name() != "cli") die("skip CLI only"); ?>
1110
<?php if (getenv("SKIP_SLOW_TESTS")) die("skip slow tests excluded by request") ?>
1211
--FILE--
1312
<?php

ext/opcache/tests/issue0149.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ phar.readonly=0
77
--SKIPIF--
88
<?php require_once('skipif.inc'); ?>
99
<?php if (!extension_loaded("phar")) die("skip"); ?>
10-
<?php if (php_sapi_name() != "cli") die("skip CLI only"); ?>
1110
--FILE--
1211
<?php
1312
$stub = "<?php header('Content-Type: text/plain;');

ext/opcache/tests/revalidate_path_01.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ opcache.enable_cli=1
66
opcache.revalidate_path=1
77
--SKIPIF--
88
<?php require_once('skipif.inc'); ?>
9-
<?php if (php_sapi_name() != "cli") die("skip CLI only"); ?>
109
--FILE--
1110
<?php
1211
$dir = dirname(__FILE__);

ext/reflection/tests/ReflectionExtension_bug66218.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
ReflectionExtension::getFunctions() ##6218 zend_register_functions breaks reflection
33
--SKIPIF--
44
<?php
5-
if (PHP_SAPI != "cli") die("skip CLI only test");
65
if (!function_exists("dl")) die("skip need dl");
76
?>
87
--FILE--

ext/standard/tests/file/bug72035.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ Bug #72035 php-cgi.exe fails to run scripts relative to drive root
33
--SKIPIF--
44
<?php
55
if(substr(PHP_OS, 0, 3) != 'WIN' ) die('skip windows only test');
6-
if(php_sapi_name() != "cli") die('skip CLI only test');
76

87
$cgi = realpath(dirname(PHP_BINARY)) . DIRECTORY_SEPARATOR . "php-cgi.exe";
98
if (!file_exists($cgi)) die('skip CGI binary not found');

ext/standard/tests/general_functions/bug70018.phpt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
--TEST--
22
Bug #70018 (exec does not strip all whitespace)
3-
--SKIPIF--
4-
<?php
5-
if ("cli" != php_sapi_name()) {
6-
die("skip.. CLI only test");
7-
}
8-
?>
93
--FILE--
104
<?php
115
$output = array();

ext/standard/tests/general_functions/head.phpt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
--TEST--
22
header() and friends
3-
--SKIPIF--
4-
<?php
5-
if (php_sapi_name() != "cli") {
6-
die("skip this test is for CLI");
7-
}
8-
?>
93
--FILE--
104
<?php
115

ext/standard/tests/general_functions/proc_nice_basic-win.phpt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ if (!defined('PHP_WINDOWS_VERSION_MAJOR')) {
88
die('skip: Only for Windows');
99
}
1010

11-
if (PHP_SAPI != 'cli') {
12-
die('skip: Only for CLI');
13-
}
14-
1511
if (getenv('SKIP_SLOW_TESTS')) {
1612
doe('skip: Slow test');
1713
}

ext/standard/tests/general_functions/proc_open-mb0.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
proc_open with bypass_shell subprocess parameter passing
33
--SKIPIF--
44
<?php # vim:syn=php
5-
if (php_sapi_name() != "cli") die('skip CLI only test');
65
if (!function_exists("proc_open")) echo "skip proc_open() is not available";
76
?>
87
--FILE--

ext/standard/tests/general_functions/proc_open-mb1.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
proc_open without bypass_shell subprocess parameter passing
33
--SKIPIF--
44
<?php # vim:syn=php
5-
if (php_sapi_name() != "cli") die('skip CLI only test');
65
if (!function_exists("proc_open")) echo "skip proc_open() is not available";
76
?>
87
--FILE--

sapi/cli/tests/cli_get_process_title_basic.phpt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ cli_get_process_title() function : basic functionality
33
--CREDITS--
44
Patrick Allaert patrickallaert@php.net
55
@nephp #nephp17
6-
--SKIPIF--
7-
<?php
8-
if (PHP_SAPI !== "cli")
9-
die("skip");
10-
?>
116
--FILE--
127
<?php
138
if (cli_set_process_title("title") && cli_get_process_title() === "title")

sapi/cli/tests/cli_get_process_title_error.phpt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ cli_get_process_title() function : error conditions
33
--CREDITS--
44
Patrick Allaert patrickallaert@php.net
55
@nephp #nephp17
6-
--SKIPIF--
7-
<?php
8-
if (PHP_SAPI !== "cli")
9-
die("skip");
10-
?>
116
--FILE--
127
<?php
138
cli_get_process_title("foo");

sapi/cli/tests/cli_set_process_title_basic.phpt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ cli_set_process_title() function : basic functionality
33
--CREDITS--
44
Patrick Allaert patrickallaert@php.net
55
@nephp #nephp17
6-
--SKIPIF--
7-
<?php
8-
if (PHP_SAPI !== "cli")
9-
die("skip");
10-
?>
116
--FILE--
127
<?php
138
if (cli_set_process_title("title") === true &&

sapi/cli/tests/cli_set_process_title_error.phpt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ cli_set_process_title() function : error conditions
33
--CREDITS--
44
Patrick Allaert patrickallaert@php.net
55
@nephp #nephp17
6-
--SKIPIF--
7-
<?php
8-
if (PHP_SAPI !== "cli")
9-
die("skip");
10-
?>
116
--FILE--
127
<?php
138
cli_set_process_title();

tests/basic/012.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
--TEST--
22
Testing $argc and $argv handling (cli)
3-
--SKIPIF--
4-
<?php if(php_sapi_name()!='cli') echo 'skip'; ?>
53
--INI--
64
register_argc_argv=1
75
variables_order=GPS

tests/basic/bug71273.phpt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
--TEST--
22
Bug #71273 A wrong ext directory setup in php.ini leads to crash
3-
--SKIPIF--
4-
<?php
5-
if ("cli" != php_sapi_name()) {
6-
die("skip CLI only");
7-
}
8-
?>
93
--FILE--
104
<?php
115
/* NOTE this file is required to be encoded in iso-8859-1 */

0 commit comments

Comments
 (0)