summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-04-14 20:53:41 +0200
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-04-14 20:53:41 +0200
commita7aa0760a01857606ea67c5d8c63df39e0274952 (patch)
tree5a6c03c700125f06de81074774093620a4e9b2f1
parent6b5506dfe7b0f5ac9ce923c1d9cdd2ebc4c72a7c (diff)
parentea65bafff940dac23c52fc307b9a2e552b983102 (diff)
Merge pull request #83 from valmat/tests
New tests
-rw-r--r--Makefile3
-rw-r--r--tests/cpp/h/variables.h10
-rw-r--r--tests/cpp/include/ini_entries/001.h34
-rw-r--r--tests/cpp/include/variables/023-cookie.h31
-rw-r--r--tests/cpp/include/variables/024-get-post.h38
-rw-r--r--tests/cpp/include/variables/025-post-raw1.h41
-rw-r--r--tests/cpp/include/variables/026-post-raw2.h76
-rw-r--r--tests/cpp/include/variables/027-env.h26
-rw-r--r--tests/cpp/include/variables/tpl.h21
-rw-r--r--tests/cpp/main.cpp9
-rw-r--r--tests/php/dbg.php2
-rwxr-xr-xtests/php/php_alias.sh2
-rw-r--r--tests/php/phpt/ini_entries/001.phpt19
-rw-r--r--tests/php/phpt/ini_entries/002.phpt69
-rw-r--r--tests/php/phpt/ini_entries/003.phpt27
-rw-r--r--tests/php/phpt/variables/011-value-casting-operators.phpt9
-rw-r--r--tests/php/phpt/variables/012-value-casting-operators-double.phpt12
-rw-r--r--tests/php/phpt/variables/023-cookie.phpt16
-rw-r--r--tests/php/phpt/variables/024-get-post.phpt26
-rw-r--r--tests/php/phpt/variables/025-post-raw1.phpt27
-rw-r--r--tests/php/phpt/variables/026-post-raw2.phpt38
-rw-r--r--tests/php/phpt/variables/027-env.phpt25
22 files changed, 506 insertions, 55 deletions
diff --git a/Makefile b/Makefile
index 890f881..9b991f2 100644
--- a/Makefile
+++ b/Makefile
@@ -155,6 +155,9 @@ hhvmcpp: ${HHVM_LIBRARY}
${PHP_LIBRARY}: ${COMMON_OBJECTS} ${PHP_OBJECTS}
${LINKER} ${PHP_LINKER_FLAGS} -o $@ ${COMMON_OBJECTS} ${PHP_OBJECTS}
+ @echo
+ @echo "Build complete."
+ @echo "Don't forget to run 'make test'."
${HHVM_LIBRARY}: ${COMMON_OBJECTS} ${HHVM_OBJECTS}
${LINKER} ${HHVM_LINKER_FLAGS} -o $@ ${COMMON_OBJECTS} ${HHVM_OBJECTS}
diff --git a/tests/cpp/h/variables.h b/tests/cpp/h/variables.h
index bdf0fca..8a074cd 100644
--- a/tests/cpp/h/variables.h
+++ b/tests/cpp/h/variables.h
@@ -22,11 +22,11 @@
#include "../include/variables/020-HashMember-2.h"
#include "../include/variables/021-HashMember-3.h"
#include "../include/variables/022-HashMember-4.h"
-//#include "../include/variables/.h"
-//#include "../include/variables/.h"
-//#include "../include/variables/.h"
-//#include "../include/variables/.h"
-//#include "../include/variables/.h"
+#include "../include/variables/023-cookie.h"
+#include "../include/variables/024-get-post.h"
+#include "../include/variables/025-post-raw1.h"
+#include "../include/variables/026-post-raw2.h"
+#include "../include/variables/027-env.h"
//#include "../include/variables/.h"
diff --git a/tests/cpp/include/ini_entries/001.h b/tests/cpp/include/ini_entries/001.h
index ece2aa4..8a4c5ca 100644
--- a/tests/cpp/include/ini_entries/001.h
+++ b/tests/cpp/include/ini_entries/001.h
@@ -10,33 +10,19 @@
*/
namespace TestIniEntries {
-
+ // will be retrieved at boot extension
+ double ini6val = 0.0;
+
void iniTest1(Php::Parameters &params)
{
- /*
- .add(Php::Ini(, "valIni1"))
- .add(Php::Ini("ini2", "valIni2", "OrigValIni2"))
- .add(Php::Ini("ini3", "valIni3", "OrigValIni3", Php::Ini::System))
- .add(Php::Ini("ini4", true, false, Php::Ini::Place::User))
- .add(Php::Ini("ini5", false));
-
- Ini::get("ini1")
- */
-
- Php::out << "ini_get(ini1) = {{" << Php::ini_get("ini1") << " | " << Php::ini_get_orig("ini1") << "}}" << std::endl;
- Php::out << "ini_get(ini2) = {{" << Php::ini_get("ini2") << " | " << Php::ini_get_orig("ini2") << "}}" << std::endl;
- Php::out << "ini_get(ini3) = {{" << Php::ini_get("ini3") << " | " << Php::ini_get_orig("ini3") << "}}" << std::endl;
- Php::out << "ini_get(ini4) = {{" << Php::ini_get("ini4") << " | " << Php::ini_get_orig("ini4") << "}}" << std::endl;
- /*
- Php::out << "extension_for_tests.some_string ={{" << Php::ini_get("extension_for_tests.some_string") << "}}" << std::endl;
- Php::out << "extension_for_tests.some_string2 ={{" << Php::ini_get("extension_for_tests.some_string2") << "}}" << std::endl;
- Php::out << "extension_for_tests.some_string3 ={{" << Php::ini_get("extension_for_tests.some_string3") << "}}" << std::endl;
- Php::out << "extension_for_tests.some_string3 ={{" << Php::ini_get("extension_for_tests.some_bool") << "}}" << std::endl;
- */
-
-
+ Php::out << "ini_get(ini1) = " << Php::ini_get("ini1") << std::endl;
+ Php::out << "ini_get(ini2) = " << Php::ini_get("ini2") << std::endl;
+ Php::out << "ini_get(ini3) = " << Php::ini_get("ini3") << std::endl;
+ Php::out << "ini_get(ini4) = " << Php::ini_get("ini4") << std::endl;
+ Php::out << "ini_get(ini5) = " << Php::ini_get("ini5") << std::endl;
+ Php::out << "ini_get(ini6) = " << Php::ini_get("ini6") << std::endl;
- return;
+ Php::out << "ini6val = " << ini6val << std::endl;
}
/**
* End of namespace
diff --git a/tests/cpp/include/variables/023-cookie.h b/tests/cpp/include/variables/023-cookie.h
new file mode 100644
index 0000000..6f74883
--- /dev/null
+++ b/tests/cpp/include/variables/023-cookie.h
@@ -0,0 +1,31 @@
+/**
+ *
+ * Test superglobal variables _COOKIE
+ * 023-cookie.phpt
+ *
+ */
+
+
+
+
+/**
+ * Set up namespace
+ */
+namespace TestVariables {
+
+
+ /*
+ * Test
+ */
+ void getCookie(void)
+ {
+ Php::out << "_COOKIE[peace] = " << Php::COOKIE["peace"] << std::endl;
+ Php::out << "_COOKIE[freedom] = " << Php::COOKIE["freedom"] << std::endl;
+ Php::out << "_COOKIE[empty] = " << Php::COOKIE["empty"] << std::endl;
+ }
+
+/**
+ * End of namespace
+ */
+}
+
diff --git a/tests/cpp/include/variables/024-get-post.h b/tests/cpp/include/variables/024-get-post.h
new file mode 100644
index 0000000..e615f0f
--- /dev/null
+++ b/tests/cpp/include/variables/024-get-post.h
@@ -0,0 +1,38 @@
+/**
+ *
+ * Test superglobal variables _GET & _POST
+ * 024-get-post.phpt
+ *
+ */
+
+
+
+
+/**
+ * Set up namespace
+ */
+namespace TestVariables {
+
+
+ /*
+ * Test
+ */
+ void get_post(void)
+ {
+ Php::out << "_GET[a] = " << Php::GET["a"] << std::endl;
+ Php::out << "_GET[b] = " << Php::GET["b"] << std::endl;
+ Php::out << "_GET[ar][elm1] = " << Php::GET["ar"]["elm1"] << std::endl;
+ Php::out << "_GET[ar][elm2] = " << Php::GET["ar"]["elm2"] << std::endl;
+
+ Php::out << "_POST[c] = " << Php::POST["c"] << std::endl;
+ Php::out << "_POST[d] = " << Php::POST["d"] << std::endl;
+ Php::out << "_POST[e] = " << Php::POST["e"] << std::endl;
+ Php::out << "_POST[e][0] = " << Php::POST["e"][0] << std::endl;
+ Php::out << "_POST[e][1] = " << Php::POST["e"][1] << std::endl;
+ }
+
+/**
+ * End of namespace
+ */
+}
+
diff --git a/tests/cpp/include/variables/025-post-raw1.h b/tests/cpp/include/variables/025-post-raw1.h
new file mode 100644
index 0000000..37c6ae1
--- /dev/null
+++ b/tests/cpp/include/variables/025-post-raw1.h
@@ -0,0 +1,41 @@
+/**
+ *
+ * Test superglobal variables _POST
+ * 025-post-raw1.phpt
+ *
+ */
+
+
+
+
+/**
+ * Set up namespace
+ */
+namespace TestVariables {
+ using namespace Php;
+
+
+ /*
+ * Test
+ */
+ void post_raw1(void)
+ {
+ out << "username => "<< POST["username"] << std::endl;
+ out << "text => "<< POST["text"] << std::endl;
+
+ /*
+ XXX TODO: conversion from ‘Php::Super’ to ‘Php::Value‘
+ Value v = POST;
+
+ out << "Array/Object contains " << v.size() << " items" << std::endl;
+ for (auto it=v.begin(), itend = v.end(); it != itend; ++it) {
+ out << "["<< it->first << "]="<< it->second << std::endl;
+ }
+ */
+ }
+
+/**
+ * End of namespace
+ */
+}
+
diff --git a/tests/cpp/include/variables/026-post-raw2.h b/tests/cpp/include/variables/026-post-raw2.h
new file mode 100644
index 0000000..d250dc8
--- /dev/null
+++ b/tests/cpp/include/variables/026-post-raw2.h
@@ -0,0 +1,76 @@
+/**
+ *
+ * Test superglobal variables _POST
+ * 026-post-raw2.phpt
+ *
+ */
+
+
+#include <iostream>
+#include <fstream>
+
+/**
+ * Set up namespace
+ */
+namespace TestVariables {
+ using namespace Php;
+
+
+ /*
+ * Test
+ */
+ void post_raw2(void)
+ {
+ out << "name1 : "<< FILES["flnm"]["name"][0] << std::endl;
+ out << "name2 : "<< FILES["flnm"]["name"][1] << std::endl;
+
+ out << "type1 : "<< FILES["flnm"]["type"][0] << std::endl;
+ out << "type2 : "<< FILES["flnm"]["type"][1] << std::endl;
+
+ out << "error1 : "<< FILES["flnm"]["error"][0] << std::endl;
+ out << "error2 : "<< FILES["flnm"]["error"][1] << std::endl;
+
+ out << "size1 : "<< FILES["flnm"]["size"][0] << std::endl;
+ out << "size2 : "<< FILES["flnm"]["size"][1] << std::endl;
+
+
+ int length0 = FILES["flnm"]["size"][0];
+ int length1 = FILES["flnm"]["size"][1];
+ char *buffer0, *buffer1;
+
+ std::ifstream file0, file1;
+ std::string filename0 = FILES["flnm"]["tmp_name"][0];
+ std::string filename1 = FILES["flnm"]["tmp_name"][1];
+
+ file0.open(filename0, std::ios::in | std::ios::binary);
+ file1.open(filename1, std::ios::in | std::ios::binary);
+
+ if(!file0.is_open() || !file1.is_open()) {
+ out << "Cannot open file." << std::endl;
+ return;
+ }
+
+ //allocate memory
+ buffer0 = new char[length0];
+ buffer1 = new char[length1];
+
+ //read data as a block to buffer
+ file0.read(buffer0, length0);
+ file1.read(buffer1, length1);
+ file0.close();
+ file1.close();
+
+ out << "content1 : ";
+ out.write(buffer0, length0);
+ out << std::endl;
+ out << "content2 : "<< buffer1 << std::endl;
+
+ delete[] buffer0;
+ delete[] buffer1;
+ }
+
+/**
+ * End of namespace
+ */
+}
+
diff --git a/tests/cpp/include/variables/027-env.h b/tests/cpp/include/variables/027-env.h
new file mode 100644
index 0000000..b8455b4
--- /dev/null
+++ b/tests/cpp/include/variables/027-env.h
@@ -0,0 +1,26 @@
+/**
+ *
+ * Test superglobal variables _ENV
+ * 027-env.phpt
+ *
+ */
+
+
+
+namespace TestVariables {
+
+
+ /*
+ * Test
+ */
+ void test_env(void)
+ {
+ Php::out << "HTTP_USER_AGENT => " << Php::SERVER["HTTP_USER_AGENT"] << std::endl;
+ Php::out << "ENVVAR1 => " << Php::SERVER["ENVVAR1"] << std::endl;
+ Php::out << "HTTP_REFERER => " << Php::SERVER["HTTP_REFERER"] << std::endl;
+ Php::out << "REQUEST_METHOD => " << Php::SERVER["REQUEST_METHOD"] << std::endl;
+ Php::out << "HTTP_HOST => " << Php::SERVER["HTTP_HOST"] << std::endl;
+ }
+
+}
+
diff --git a/tests/cpp/include/variables/tpl.h b/tests/cpp/include/variables/tpl.h
index 3c4ed7c..0df5892 100644
--- a/tests/cpp/include/variables/tpl.h
+++ b/tests/cpp/include/variables/tpl.h
@@ -1,7 +1,7 @@
/**
*
* Test variables
- * phptname.phpt
+ * phptname.phpt
*
*/
@@ -12,16 +12,15 @@
* Set up namespace
*/
namespace TestVariables {
-
-
- /*
- * Test
- */
- void fnname(Php::Parameters &params)
- {
-
-
- }
+
+ /*
+ * Test
+ */
+ void fnname(Php::Parameters &params)
+ {
+
+
+ }
/**
* End of namespace
diff --git a/tests/cpp/main.cpp b/tests/cpp/main.cpp
index 0f36ecc..37ba5ed 100644
--- a/tests/cpp/main.cpp
+++ b/tests/cpp/main.cpp
@@ -120,6 +120,11 @@ extern "C"
extension.add("TestVariables\\test_HashMember_2", TestVariables::test_HashMember_2);
extension.add("TestVariables\\test_HashMember_3", TestVariables::test_HashMember_3);
extension.add("TestVariables\\test_HashMember_4", TestVariables::test_HashMember_4);
+ extension.add("TestVariables\\getCookie", TestVariables::getCookie);
+ extension.add("TestVariables\\get_post", TestVariables::get_post);
+ extension.add("TestVariables\\post_raw1", TestVariables::post_raw1);
+ extension.add("TestVariables\\post_raw2", TestVariables::post_raw2);
+ extension.add("TestVariables\\test_env", TestVariables::test_env);
@@ -155,8 +160,8 @@ extern "C"
extension.add("TestIniEntries\\iniTest1", TestIniEntries::iniTest1);
extension.onStartup([](){
- Php::out << "ini_get(ini1) = {{" << Php::ini_get("ini1") << " | " << Php::ini_get_orig("ini1") << "}}" << std::endl;
- Php::out << "ini_get(ini2) = {{" << Php::ini_get("ini2") << " | " << Php::ini_get_orig("ini2") << "}}" << std::endl;
+ // Retrieve a value at boot extension
+ TestIniEntries::ini6val = Php::ini_get("ini6");
});
diff --git a/tests/php/dbg.php b/tests/php/dbg.php
index 70e71ef..e626ce0 100644
--- a/tests/php/dbg.php
+++ b/tests/php/dbg.php
@@ -12,8 +12,6 @@
-TestIniEntries\iniTest1();
-exit;
echo "\x1b[1;31m";
(new ReflectionExtension('extension_for_tests') )->info();
echo "\x1b[0m";
diff --git a/tests/php/php_alias.sh b/tests/php/php_alias.sh
index 6947325..4393172 100755
--- a/tests/php/php_alias.sh
+++ b/tests/php/php_alias.sh
@@ -16,4 +16,4 @@ fi
LD_LIBRARY_PATH="$(cd $PWD/../.. && echo $PWD):${LD_LIBRARY_PATH}"
export LD_LIBRARY_PATH
-/usr/bin/php -d extension_dir=../ext_dir -d extension=extfortest.so -d ini7=47 -d extension_for_tests.frcli=frcli $1 $2 $3 $4 $5
+/usr/bin/php -d extension_dir=../ext_dir -d extension=extfortest.so -d ini7=47 -d ini1=ReValIni1 -d ini2=ReValIni2 $1 $2 $3 $4 $5
diff --git a/tests/php/phpt/ini_entries/001.phpt b/tests/php/phpt/ini_entries/001.phpt
new file mode 100644
index 0000000..e85af06
--- /dev/null
+++ b/tests/php/phpt/ini_entries/001.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Test ini entries #1
+--SKIPIF--
+<?php if (!extension_loaded("extension_for_tests")) print "skip"; ?>
+--INI--
+ini2=ReValIni2
+--FILEEOF--
+<?php
+
+TestIniEntries\iniTest1();
+
+--EXPECT--
+ini_get(ini1) = valIni1
+ini_get(ini2) = ReValIni2
+ini_get(ini3) = valIni3
+ini_get(ini4) = On
+ini_get(ini5) = Off
+ini_get(ini6) = 55
+ini6val = 55 \ No newline at end of file
diff --git a/tests/php/phpt/ini_entries/002.phpt b/tests/php/phpt/ini_entries/002.phpt
new file mode 100644
index 0000000..04b1b46
--- /dev/null
+++ b/tests/php/phpt/ini_entries/002.phpt
@@ -0,0 +1,69 @@
+--TEST--
+Test ini entries #2
+--SKIPIF--
+<?php if (!extension_loaded("extension_for_tests")) print "skip"; ?>
+--INI--
+ini2=ReValIni2
+ini6=33
+--FILEEOF--
+<?php
+
+var_export( ini_get_all ( 'extension_for_tests' ) );
+
+--EXPECT--
+array (
+ 'ini1' =>
+ array (
+ 'global_value' => 'valIni1',
+ 'local_value' => 'valIni1',
+ 'access' => 7,
+ ),
+ 'ini2' =>
+ array (
+ 'global_value' => 'OrigValIni2',
+ 'local_value' => 'ReValIni2',
+ 'access' => 7,
+ ),
+ 'ini3' =>
+ array (
+ 'global_value' => 'OrigValIni3',
+ 'local_value' => 'valIni3',
+ 'access' => 4,
+ ),
+ 'ini4' =>
+ array (
+ 'global_value' => 'Off',
+ 'local_value' => 'On',
+ 'access' => 1,
+ ),
+ 'ini5' =>
+ array (
+ 'global_value' => 'Off',
+ 'local_value' => 'Off',
+ 'access' => 7,
+ ),
+ 'ini6' =>
+ array (
+ 'global_value' => '11',
+ 'local_value' => '33',
+ 'access' => 7,
+ ),
+ 'ini7' =>
+ array (
+ 'global_value' => '5',
+ 'local_value' => '74',
+ 'access' => 7,
+ ),
+ 'ini8' =>
+ array (
+ 'global_value' => '6.283185',
+ 'local_value' => '3.141593',
+ 'access' => 7,
+ ),
+ 'ini9' =>
+ array (
+ 'global_value' => '5.436564',
+ 'local_value' => '2.718282',
+ 'access' => 1,
+ ),
+) \ No newline at end of file
diff --git a/tests/php/phpt/ini_entries/003.phpt b/tests/php/phpt/ini_entries/003.phpt
new file mode 100644
index 0000000..5ad6efb
--- /dev/null
+++ b/tests/php/phpt/ini_entries/003.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Test ini entries #3
+--DESCRIPTION--
+Test to check palce action of ini entries
+--SKIPIF--
+<?php if (!extension_loaded("extension_for_tests")) print "skip"; ?>
+--FILEEOF--
+<?php
+
+echo ini_get('ini2'), PHP_EOL;
+echo ini_get('ini3'), PHP_EOL;
+ini_set('ini2', 'newIni2');
+ini_set('ini3', 'newIni3');
+echo ini_get('ini2'), PHP_EOL;
+echo ini_get('ini3'), PHP_EOL;
+ini_restore('ini2');
+ini_restore('ini3');
+echo ini_get('ini2'), PHP_EOL;
+echo ini_get('ini3');
+
+--EXPECT--
+valIni2
+valIni3
+newIni2
+valIni3
+valIni2
+valIni3 \ No newline at end of file
diff --git a/tests/php/phpt/variables/011-value-casting-operators.phpt b/tests/php/phpt/variables/011-value-casting-operators.phpt
index 3fe6817..27e92c7 100644
--- a/tests/php/phpt/variables/011-value-casting-operators.phpt
+++ b/tests/php/phpt/variables/011-value-casting-operators.phpt
@@ -1,13 +1,15 @@
--TEST--
-Test Php::Value casting operators
+Test Php::Value casting operators (64bit OS only)
--DESCRIPTION--
The Php::Value class has casting operators to cast the object to almost every thinkable native type.
native_value_casting - repeats the behavior of c++ functions TestVariables\value_casting
the output of each of these functions should be the same
+Skip if the current OS is not 64-bit architecture.
+
--SKIPIF--
-<?php if (!extension_loaded("extension_for_tests")) print "skip"; ?>
+<?php if (!extension_loaded("extension_for_tests") || 'x86_64' != php_uname('m') ) print "skip"; ?>
--FILEEOF--
<?php
@@ -148,5 +150,4 @@ Test 83:
Test 26:
long:26
string:26
- bool:Yes
-
+ bool:Yes \ No newline at end of file
diff --git a/tests/php/phpt/variables/012-value-casting-operators-double.phpt b/tests/php/phpt/variables/012-value-casting-operators-double.phpt
index 32086ef..babd476 100644
--- a/tests/php/phpt/variables/012-value-casting-operators-double.phpt
+++ b/tests/php/phpt/variables/012-value-casting-operators-double.phpt
@@ -21,9 +21,9 @@ function out($v) {
//echo PHP_EOL;
}
-out(5555555555555555);
+out(5555555555555);
out("999999999999999");
-out(999999999999999);
+out(99999999999999);
out(5);
out(-99999999);
out("18");
@@ -42,12 +42,12 @@ out(0x1A); // hexadecimal number (equivalent to 26 decimal)
--EXPECT--
-Test 5555555555555555:
-5555555555555555
+Test 5555555555555:
+5555555555555
Test '999999999999999':
999999999999999
-Test 999999999999999:
-999999999999999
+Test 99999999999999:
+99999999999999
Test 5:
5
Test -99999999:
diff --git a/tests/php/phpt/variables/023-cookie.phpt b/tests/php/phpt/variables/023-cookie.phpt
new file mode 100644
index 0000000..0648188
--- /dev/null
+++ b/tests/php/phpt/variables/023-cookie.phpt
@@ -0,0 +1,16 @@
+--TEST--
+test cookie
+--SKIPIF--
+<?php if (!extension_loaded("extension_for_tests")) print "skip"; ?>
+--COOKIE--
+peace=toTheWorld;freedom=toThePeople
+--FILEEOF--
+<?php
+
+
+TestVariables\getCookie();
+
+--EXPECT--
+_COOKIE[peace] = toTheWorld
+_COOKIE[freedom] = toThePeople
+_COOKIE[empty] = \ No newline at end of file
diff --git a/tests/php/phpt/variables/024-get-post.phpt b/tests/php/phpt/variables/024-get-post.phpt
new file mode 100644
index 0000000..9ac1243
--- /dev/null
+++ b/tests/php/phpt/variables/024-get-post.phpt
@@ -0,0 +1,26 @@
+--TEST--
+test get and post
+--SKIPIF--
+<?php if (!extension_loaded("extension_for_tests")) print "skip"; ?>
+--GET--
+a=<b>test</b>&b=http://phpcpp.com&ar[elm1]=1234&ar[elm2]=0660&a=0234
+--POST--
+c=<p>string</p>&d=12345.7&e[]=e1&e[]=e2
+--FILEEOF--
+<?php
+
+
+TestVariables\get_post();
+
+--EXPECTF--
+_GET[a] = 0234
+_GET[b] = http://phpcpp.com
+_GET[ar][elm1] = 1234
+_GET[ar][elm2] = 0660
+_POST[c] = <p>string</p>
+_POST[d] = 12345.7
+
+Notice: Array to string conversion in %s/024-get-post.php on line %d
+_POST[e] = Array
+_POST[e][0] = e1
+_POST[e][1] = e2 \ No newline at end of file
diff --git a/tests/php/phpt/variables/025-post-raw1.phpt b/tests/php/phpt/variables/025-post-raw1.phpt
new file mode 100644
index 0000000..76fed0f
--- /dev/null
+++ b/tests/php/phpt/variables/025-post-raw1.phpt
@@ -0,0 +1,27 @@
+--TEST--
+test post raw #1
+--SKIPIF--
+<?php if (!extension_loaded("extension_for_tests")) print "skip"; ?>
+--POST_RAW--
+Content-type: multipart/form-data, boundary=AaB03x
+
+--AaB03x
+content-disposition: form-data; name="username"
+
+valmat
+--AaB03x
+content-disposition: form-data; name="text"
+
+Hellow World!
+--AaB03x
+--FILEEOF--
+<?php
+
+
+TestVariables\post_raw1();
+
+//foreach($_POST as $k => $v) {echo "\n$k => $v";}
+
+--EXPECTF--
+username => valmat
+text => Hellow World! \ No newline at end of file
diff --git a/tests/php/phpt/variables/026-post-raw2.phpt b/tests/php/phpt/variables/026-post-raw2.phpt
new file mode 100644
index 0000000..4bee44c
--- /dev/null
+++ b/tests/php/phpt/variables/026-post-raw2.phpt
@@ -0,0 +1,38 @@
+--TEST--
+Post files
+--DESCRIPTION--
+Simulates the file upload method post
+test post raw #2
+--SKIPIF--
+<?php if (!extension_loaded("extension_for_tests")) print "skip"; ?>
+--POST_RAW--
+Content-type: multipart/form-data, boundary=AaB03x
+
+--AaB03x
+content-disposition: form-data; name="flnm[]"; filename="file1.txt"
+Content-Type: text/plain
+
+abcdef123456789
+--AaB03x
+content-disposition: form-data; name="flnm[]"; filename="file2.txt"
+Content-Type: text/plain
+
+«£¥§©®°±¶Я⅓⅘⅞Ⅻↆ❄❅❆⚑⚐⌛⌚〰»
+--AaB03x
+--FILEEOF--
+<?php
+
+
+TestVariables\post_raw2();
+
+--EXPECTF--
+name1 : file1.txt
+name2 : file2.txt
+type1 : text/plain
+type2 : text/plain
+error1 : 0
+error2 : 0
+size1 : 15
+size2 : 61
+content1 : abcdef123456789
+content2 : «£¥§©®°±¶Я⅓⅘⅞Ⅻↆ❄❅❆⚑⚐⌛⌚〰» \ No newline at end of file
diff --git a/tests/php/phpt/variables/027-env.phpt b/tests/php/phpt/variables/027-env.phpt
new file mode 100644
index 0000000..4e84cfe
--- /dev/null
+++ b/tests/php/phpt/variables/027-env.phpt
@@ -0,0 +1,25 @@
+--TEST--
+test superglobal _ENV
+--SKIPIF--
+<?php if (!extension_loaded("extension_for_tests")) print "skip"; ?>
+--ENV--
+return <<<END
+ENVVAR1=ENVVAL1
+HTTP_REFERER=http://spb.1gs.ru/
+HTTP_USER_AGENT=Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:28.0) Gecko/20100101 Firefox/28.0
+HTTP_COOKIE=usr=1cfa6e9905; pc=0; PHPSESSID=4d08j9phpe1c6; vmode=0
+HTTP_HOST=phpcpp.com
+END;
+--FILEEOF--
+<?php
+
+
+TestVariables\test_env();
+//var_export($_SERVER); echo PHP_EOL, PHP_EOL, PHP_EOL;
+
+--EXPECTF--
+HTTP_USER_AGENT => Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:28.0) Gecko/20100101 Firefox/28.0
+ENVVAR1 => ENVVAL1
+HTTP_REFERER => http://spb.1gs.ru/
+REQUEST_METHOD => GET
+HTTP_HOST => phpcpp.com