mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
more POST+array tests
This commit is contained in:
parent
f03fe1c09d
commit
43db0fce03
8 changed files with 155 additions and 0 deletions
15
tests/basic/013.phpt
Normal file
15
tests/basic/013.phpt
Normal file
|
@ -0,0 +1,15 @@
|
|||
--TEST--
|
||||
POST Method test and arrays
|
||||
--SKIPIF--
|
||||
<?php if (php_sapi_name()=='cli') echo 'skip'; ?>
|
||||
--POST--
|
||||
a[]=1
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump($_POST['a']);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "1"
|
||||
}
|
17
tests/basic/014.phpt
Normal file
17
tests/basic/014.phpt
Normal file
|
@ -0,0 +1,17 @@
|
|||
--TEST--
|
||||
POST Method test and arrays - 2
|
||||
--SKIPIF--
|
||||
<?php if (php_sapi_name()=='cli') echo 'skip'; ?>
|
||||
--POST--
|
||||
a[]=1&a[]=1
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump($_POST['a']);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(1) "1"
|
||||
[1]=>
|
||||
string(1) "1"
|
||||
}
|
15
tests/basic/015.phpt
Normal file
15
tests/basic/015.phpt
Normal file
|
@ -0,0 +1,15 @@
|
|||
--TEST--
|
||||
POST Method test and arrays - 3
|
||||
--SKIPIF--
|
||||
<?php if (php_sapi_name()=='cli') echo 'skip'; ?>
|
||||
--POST--
|
||||
a[]=1&a[0]=5
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump($_POST['a']);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "5"
|
||||
}
|
17
tests/basic/016.phpt
Normal file
17
tests/basic/016.phpt
Normal file
|
@ -0,0 +1,17 @@
|
|||
--TEST--
|
||||
POST Method test and arrays - 4
|
||||
--SKIPIF--
|
||||
<?php if (php_sapi_name()=='cli') echo 'skip'; ?>
|
||||
--POST--
|
||||
a[a]=1&a[b]=3
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump($_POST['a']);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
["a"]=>
|
||||
string(1) "1"
|
||||
["b"]=>
|
||||
string(1) "3"
|
||||
}
|
19
tests/basic/017.phpt
Normal file
19
tests/basic/017.phpt
Normal file
|
@ -0,0 +1,19 @@
|
|||
--TEST--
|
||||
POST Method test and arrays - 5
|
||||
--SKIPIF--
|
||||
<?php if (php_sapi_name()=='cli') echo 'skip'; ?>
|
||||
--POST--
|
||||
a[]=1&a[a]=1&a[b]=3
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump($_POST['a']);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(1) "1"
|
||||
["a"]=>
|
||||
string(1) "1"
|
||||
["b"]=>
|
||||
string(1) "3"
|
||||
}
|
36
tests/basic/018.phpt
Normal file
36
tests/basic/018.phpt
Normal file
|
@ -0,0 +1,36 @@
|
|||
--TEST--
|
||||
POST Method test and arrays - 6
|
||||
--SKIPIF--
|
||||
<?php if (php_sapi_name()=='cli') echo 'skip'; ?>
|
||||
--POST--
|
||||
a[][]=1&a[][]=3&b[a][b][c]=1&b[a][b][d]=1
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump($_POST['a']);
|
||||
var_dump($_POST['b']);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "1"
|
||||
}
|
||||
[1]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(1) "3"
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
["a"]=>
|
||||
array(1) {
|
||||
["b"]=>
|
||||
array(2) {
|
||||
["c"]=>
|
||||
string(1) "1"
|
||||
["d"]=>
|
||||
string(1) "1"
|
||||
}
|
||||
}
|
||||
}
|
19
tests/basic/019.phpt
Normal file
19
tests/basic/019.phpt
Normal file
|
@ -0,0 +1,19 @@
|
|||
--TEST--
|
||||
POST Method test and arrays - 7
|
||||
--SKIPIF--
|
||||
<?php if (php_sapi_name()=='cli') echo 'skip'; ?>
|
||||
--POST--
|
||||
a[]=1&a[]]=3&a[[]=4
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump($_POST['a']);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(3) {
|
||||
[0]=>
|
||||
string(1) "1"
|
||||
[1]=>
|
||||
string(1) "3"
|
||||
["["]=>
|
||||
string(1) "4"
|
||||
}
|
17
tests/basic/020.phpt
Normal file
17
tests/basic/020.phpt
Normal file
|
@ -0,0 +1,17 @@
|
|||
--TEST--
|
||||
POST Method test and arrays - 8
|
||||
--SKIPIF--
|
||||
<?php if (php_sapi_name()=='cli') echo 'skip'; ?>
|
||||
--POST--
|
||||
a[a[]]=1&a[b[]]=3
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump($_POST['a']);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
["a["]=>
|
||||
string(1) "1"
|
||||
["b["]=>
|
||||
string(1) "3"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue