1
0
mirror of https://github.com/php/php-src.git synced 2026-04-13 02:52:48 +02:00

add tests

This commit is contained in:
Anatol Belski
2016-01-28 13:27:26 +01:00
parent 54c210d2ea
commit 828364e59c
4 changed files with 44 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
--TEST--
Test escapeshellarg() string with \0 bytes
--FILE--
<?php
escapeshellarg("hello\0world");
?>
===DONE===
--EXPECTF--
Fatal error: escapeshellarg(): Input string contains NULL bytes in %s on line %d

View File

@@ -0,0 +1,12 @@
--TEST--
Test escapeshellarg() allowed argument length
--FILE--
<?php
ini_set('memory_limit', -1);
$var_2 = str_repeat('A', 1024*1024*64);
escapeshellarg($var_2);
?>
===DONE===
--EXPECTF--
Fatal error: escapeshellarg(): Argument exceeds the allowed length of %d bytes in %s on line %d

View File

@@ -0,0 +1,10 @@
--TEST--
Test escapeshellcmd() string with \0 bytes
--FILE--
<?php
escapeshellcmd("hello\0world");
?>
===DONE===
--EXPECTF--
Fatal error: escapeshellcmd(): Input string contains NULL bytes in %s on line %d

View File

@@ -0,0 +1,12 @@
--TEST--
Test escapeshellcmd() allowed argument length
--FILE--
<?php
ini_set('memory_limit', -1);
$var_2 = str_repeat('A', 1024*1024*64);
escapeshellcmd($var_2);
?>
===DONE===
--EXPECTF--
Fatal error: escapeshellcmd(): Command exceeds the allowed length of %d bytes in %s on line %d