1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 02:33:17 +02:00
Files
archived-php-src/ext/standard/tests/file/popen_pclose_error.phpt
T
2020-06-24 13:13:44 +02:00

29 lines
609 B
PHP

--TEST--
Test popen() and pclose function: error conditions
--SKIPIF--
<?php
if (strtoupper( substr(PHP_OS, 0, 3) ) == 'SUN')
die("skip Not Valid for Sun Solaris");
?>
--FILE--
<?php
$file_path = __DIR__;
echo "*** Testing for error conditions ***\n";
var_dump( popen("abc.txt", "rw") ); // Invalid mode Argument
$file_handle = fopen($file_path."/popen.tmp", "w");
fclose($file_handle);
echo "\n--- Done ---";
?>
--CLEAN--
<?php
$file_path = __DIR__;
unlink($file_path."/popen.tmp");
?>
--EXPECTF--
*** Testing for error conditions ***
Warning: popen(abc.txt,rw): %s on line %d
bool(false)
--- Done ---