Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions ext/date/tests/gmstrftime_basic.phpt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
--TEST--
Test gmstrftime() function : basic functionality
Test gmstrftime() function : basic functionality
--SKIPIF--
<?php if (!function_exists('gmstrftime')) die('skip gmstrftime function not available'); ?>
--FILE--
<?php
/* Prototype : string gmstrftime(string format [, int timestamp])
* Description: Format a GMT/UCT time/date according to locale settings
* Description: Format a GMT/UCT time/date according to locale settings
* Source code: ext/date/php_date.c
* Alias to functions:
* Alias to functions:
*/

echo "*** Testing gmstrftime() : basic functionality ***\n";
Expand Down
8 changes: 5 additions & 3 deletions ext/date/tests/gmstrftime_error.phpt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
--TEST--
Test gmstrftime() function : error conditions
Test gmstrftime() function : error conditions
--SKIPIF--
<?php if (!function_exists('gmstrftime')) die('skip gmstrftime function not available'); ?>
--FILE--
<?php
/* Prototype : string gmstrftime(string format [, int timestamp])
* Description: Format a GMT/UCT time/date according to locale settings
* Description: Format a GMT/UCT time/date according to locale settings
* Source code: ext/date/php_date.c
* Alias to functions:
* Alias to functions:
*/

echo "*** Testing gmstrftime() : error conditions ***\n";
Expand Down
6 changes: 4 additions & 2 deletions ext/date/tests/gmstrftime_variation1.phpt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
--TEST--
Test gmstrftime() function : usage variation - Passing unexpected values to first argument 'format'.
--SKIPIF--
<?php if (!function_exists('gmstrftime')) die('skip gmstrftime function not available'); ?>
--FILE--
<?php
/* Prototype : string gmstrftime(string format [, int timestamp])
* Description: Format a GMT/UCT time/date according to locale settings
* Description: Format a GMT/UCT time/date according to locale settings
* Source code: ext/date/php_date.c
* Alias to functions:
* Alias to functions:
*/

echo "*** Testing gmstrftime() : usage variation ***\n";
Expand Down
8 changes: 5 additions & 3 deletions ext/date/tests/gmstrftime_variation3.phpt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
--TEST--
Test gmstrftime() function : usage variation - Passing week related format strings to format argument.
--SKIPIF--
<?php if (!function_exists('gmstrftime')) die('skip gmstrftime function not available'); ?>
--FILE--
<?php
/* Prototype : string gmstrftime(string format [, int timestamp])
* Description: Format a GMT/UCT time/date according to locale settings
* Description: Format a GMT/UCT time/date according to locale settings
* Source code: ext/date/php_date.c
* Alias to functions:
* Alias to functions:
*/

echo "*** Testing gmstrftime() : usage variation ***\n";
Expand All @@ -18,7 +20,7 @@ $inputs = array(
'Abbreviated weekday name' => "%a",
'Full weekday name' => "%A",
'Week number of the year' => "%U",
'Week number of the year in decimal number' => "%W",
'Week number of the year in decimal number' => "%W",
);

// loop through each element of the array for timestamp
Expand Down
6 changes: 4 additions & 2 deletions ext/date/tests/gmstrftime_variation4.phpt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
--TEST--
Test gmstrftime() function : usage variation - Passing month related format strings to format argument.
--SKIPIF--
<?php if (!function_exists('gmstrftime')) die('skip gmstrftime function not available'); ?>
--FILE--
<?php
/* Prototype : string gmstrftime(string format [, int timestamp])
* Description: Format a GMT/UCT time/date according to locale settings
* Description: Format a GMT/UCT time/date according to locale settings
* Source code: ext/date/php_date.c
* Alias to functions:
* Alias to functions:
*/

echo "*** Testing gmstrftime() : usage variation ***\n";
Expand Down
8 changes: 5 additions & 3 deletions ext/date/tests/gmstrftime_variation5.phpt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
--TEST--
Test gmstrftime() function : usage variation - Passing date related format strings to format argument.
--SKIPIF--
<?php if (!function_exists('gmstrftime')) die('skip gmstrftime function not available'); ?>
--FILE--
<?php
/* Prototype : string gmstrftime(string format [, int timestamp])
* Description: Format a GMT/UCT time/date according to locale settings
* Description: Format a GMT/UCT time/date according to locale settings
* Source code: ext/date/php_date.c
* Alias to functions:
* Alias to functions:
*/

echo "*** Testing gmstrftime() : usage variation ***\n";
Expand All @@ -20,7 +22,7 @@ date_default_timezone_set("Asia/Calcutta");
$inputs = array(
'Year as decimal number without a century' => "%y",
'Year as decimal number including the century' => "%Y",
'Time zone offset' => "%Z",
'Time zone offset' => "%Z",
'Time zone offset' => "%z",
);

Expand Down
6 changes: 4 additions & 2 deletions ext/date/tests/gmstrftime_variation6.phpt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
--TEST--
Test gmstrftime() function : usage variation - Passing time related format strings to format argument.
--SKIPIF--
<?php if (!function_exists('gmstrftime')) die('skip gmstrftime function not available'); ?>
--FILE--
<?php
/* Prototype : string gmstrftime(string format [, int timestamp])
* Description: Format a GMT/UCT time/date according to locale settings
* Description: Format a GMT/UCT time/date according to locale settings
* Source code: ext/date/php_date.c
* Alias to functions:
* Alias to functions:
*/

echo "*** Testing gmstrftime() : usage variation ***\n";
Expand Down
6 changes: 4 additions & 2 deletions ext/date/tests/gmstrftime_variation7.phpt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
--TEST--
Test gmstrftime() function : usage variation - Passing day related format strings to format argument.
--SKIPIF--
<?php if (!function_exists('gmstrftime')) die('skip gmstrftime function not available'); ?>
--FILE--
<?php
/* Prototype : string gmstrftime(string format [, int timestamp])
* Description: Format a GMT/UCT time/date according to locale settings
* Description: Format a GMT/UCT time/date according to locale settings
* Source code: ext/date/php_date.c
* Alias to functions:
* Alias to functions:
*/

echo "*** Testing gmstrftime() : usage variation ***\n";
Expand Down
6 changes: 4 additions & 2 deletions ext/date/tests/gmstrftime_variation8.phpt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
--TEST--
Test gmstrftime() function : usage variation - Passing literal related strings to format argument.
--SKIPIF--
<?php if (!function_exists('gmstrftime')) die('skip gmstrftime function not available'); ?>
--FILE--
<?php
/* Prototype : string gmstrftime(string format [, int timestamp])
* Description: Format a GMT/UCT time/date according to locale settings
* Description: Format a GMT/UCT time/date according to locale settings
* Source code: ext/date/php_date.c
* Alias to functions:
* Alias to functions:
*/

echo "*** Testing gmstrftime() : usage variation ***\n";
Expand Down
8 changes: 5 additions & 3 deletions ext/standard/tests/file/proc_open01.phpt
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
--TEST--
proc_open() regression test 1 (proc_open() leak)
--SKIPIF--
<?php if (!function_exists('proc_open')) die ('skip proc_open function not available'); ?>
--FILE--
<?php
$pipes = array(1, 2, 3);
$orig_pipes = $pipes;
$php = getenv('TEST_PHP_EXECUTABLE');
$php = getenv('TEST_PHP_EXECUTABLE');
if ($php === false) {
die("no php executable defined");
}
}
$proc = proc_open(
"$php -n",
array(0 => array('pipe', 'r'), 1 => array('pipe', 'w')),
Expand All @@ -24,7 +26,7 @@ fflush($pipes[0]);
fclose($pipes[0]);
$cnt = '';
$n=0;
for ($left = strlen($test_string); $left > 0;) {
for ($left = strlen($test_string); $left > 0;) {
if (++$n >1000) {
print "terminated after 1000 iterations\n";
break;
Expand Down
1 change: 1 addition & 0 deletions ext/standard/tests/general_functions/bug34794.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Bug #34794 (proc_close() hangs when used with two processes)
--SKIPIF--
<?php
if (!is_executable('/bin/cat')) echo 'skip cat not found';
if (!function_exists('proc_open')) die ('skip proc_open function not available');
?>
--FILE--
<?php
Expand Down
1 change: 1 addition & 0 deletions ext/standard/tests/general_functions/bug39322.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Bug #39322 (proc_terminate() losing process resource)
--SKIPIF--
<?php
if (!function_exists('proc_open')) die ('skip proc_open function not available');
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
if (!is_executable('/bin/sleep')) echo 'skip sleep not found';
?>
Expand Down
17 changes: 10 additions & 7 deletions ext/standard/tests/general_functions/bug44667.phpt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
--TEST--
Bug #44667 (proc_open() does not handle pipes with the mode 'wb' correctly)
--SKIPIF--
<?php if (!is_executable('/bin/cat')) echo 'skip cat not found'; ?>
<?php
if (!is_executable('/bin/cat')) echo 'skip cat not found';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any difference between echo 'skip not found'; and die 'skip proc_open..' ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@staabm The only one that I know is, with we run the generated test.sh, it would break. die would return the message and kill the script.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should echo or die be unified ?

Copy link
Contributor Author

@carusogabriel carusogabriel Feb 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@staabm Sure it does, SKIPIF should use die. QA recommends this already.

I'm waiting for this one, related to unifying requirement for skipif.inc, then we can unify this as well 😄

if (!function_exists('proc_open')) die ('skip proc_open function not available');
?>
--FILE--
<?php

Expand All @@ -11,19 +14,19 @@ $descriptor_spec = array(
0 => array('pipe', 'rb'),
1 => array('pipe', 'wb'),
);

$proc = proc_open('cat', $descriptor_spec, $pipes);

fwrite($pipes[0], 'Hello', 5);
fflush($pipes[0]);
fclose($pipes[0]);

$result = fread($pipes[1], 5);
fclose($pipes[1]);

proc_close($proc);
echo "Result is: ", $result, "\n";

echo "Result is: ", $result, "\n";

echo "Done\n";

Expand Down
2 changes: 2 additions & 0 deletions ext/standard/tests/general_functions/bug72306.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
--TEST--
Bug #72306 (Heap overflow through proc_open and $env parameter)
--SKIPIF--
<?php if (!function_exists('proc_open')) die ('skip proc_open function not available'); ?>
--FILE--
<?php
class moo {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
--TEST--
Test function getservbyname()
--SKIPIF--
<?php if (!function_exists('getservbyname')) die('skip getservbyname function not available') ?>
--CREDITS--
Italian PHP TestFest 2009 Cesena 19-20-21 june
Fabio Fabbrucci ([email protected])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
--TEST--
Test function getservbyname() by calling it more than or less than its expected arguments
--SKIPIF--
<?php if (!function_exists('getservbyname')) die('skip getservbyname function not available') ?>
--CREDITS--
Italian PHP TestFest 2009 Cesena 19-20-21 june
Fabio Fabbrucci ([email protected])
Expand All @@ -8,7 +10,7 @@ Danilo Sanchi ([email protected])
--FILE--
<?php
$service = "www";
$protocol = "tcp";
$protocol = "tcp";
$extra_arg = 12;
var_dump(getservbyname($service, $protocol, $extra_arg ) );
var_dump(getservbyname($service));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
--TEST--
Test function getservbyname() by substituting argument 1 with array values.
--SKIPIF--
<?php if (!function_exists('getservbyname')) die('skip getservbyname function not available') ?>
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
--TEST--
Test function getservbyname() by substituting argument 2 with float values.
--SKIPIF--
<?php if (!function_exists('getservbyname')) die('skip getservbyname function not available') ?>
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
--TEST--
Test function getservbyname() by substituting argument 2 with int values.
--SKIPIF--
<?php if (!function_exists('getservbyname')) die('skip getservbyname function not available') ?>
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
--TEST--
Test function getservbyname() by substituting argument 2 with object values.
--SKIPIF--
<?php if (!function_exists('getservbyname')) die('skip getservbyname function not available') ?>
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
--TEST--
Test function getservbyname() by substituting argument 2 with string values.
--SKIPIF--
<?php if (!function_exists('getservbyname')) die('skip getservbyname function not available') ?>
--FILE--
<?php


echo "*** Test substituting argument 2 with string values ***\n";

$service = "www";
$service = "www";


$heredoc = <<<EOT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
--TEST--
Test function getservbyname() by substituting argument 1 with boolean values.
--SKIPIF--
<?php if (!function_exists('getservbyname')) die('skip getservbyname function not available') ?>
--FILE--
<?php


echo "*** Test substituting argument 1 with boolean values ***\n";

$protocol = "tcp";
$protocol = "tcp";


$variation_array = array(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
--TEST--
Test function getservbyname() by substituting argument 1 with emptyUnsetUndefNull values.
--SKIPIF--
<?php if (!function_exists('getservbyname')) die('skip getservbyname function not available') ?>
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
--TEST--
Test function getservbyname() by substituting argument 1 with float values.
--SKIPIF--
<?php if (!function_exists('getservbyname')) die('skip getservbyname function not available') ?>
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
--TEST--
Test function getservbyname() by substituting argument 1 with int values.
--SKIPIF--
<?php if (!function_exists('getservbyname')) die('skip getservbyname function not available') ?>
--FILE--
<?php


echo "*** Test substituting argument 1 with int values ***\n";

$protocol = "tcp";
$protocol = "tcp";


$variation_array = array (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
--TEST--
Test function getservbyname() by substituting argument 1 with object values.
--SKIPIF--
<?php if (!function_exists('getservbyname')) die('skip getservbyname function not available') ?>
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
--TEST--
Test function getservbyname() by substituting argument 1 with string values.
--SKIPIF--
<?php if (!function_exists('getservbyname')) die('skip getservbyname function not available') ?>
--FILE--
<?php

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
--TEST--
Test function getservbyname() by substituting argument 2 with array values.
--SKIPIF--
<?php if (!function_exists('getservbyname')) die('skip getservbyname function not available') ?>
--FILE--
<?php

Expand Down
Loading