Tests: initial PHP application tests.

This commit is contained in:
Andrey Zelenkov
2018-05-22 20:20:14 +03:00
parent 7d224bfc9e
commit 3b7238996a
11 changed files with 193 additions and 0 deletions

6
test/php/404/404.html Normal file
View File

@@ -0,0 +1,6 @@
<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
</body>
</html>

4
test/php/404/index.php Normal file
View File

@@ -0,0 +1,4 @@
<?php
http_response_code(404);
include('404.html');
?>

View File

@@ -0,0 +1,5 @@
<?php if ($_SERVER['REQUEST_METHOD'] === 'GET'): ?>
True
<?php else: ?>
False
<?php endif; ?>

View File

@@ -0,0 +1,4 @@
<?php
header('X-Cookie-1: ' . $_COOKIE['var']);
header('X-Cookie-2: ' . $_COOKIE['var2']);
?>

View File

@@ -0,0 +1,7 @@
<?php
header('Content-Length: 0');
header('X-Var-1: ' . $_GET['var1']);
header('X-Var-2: ' . $_GET['var2'] . isset($_GET['var2']));
header('X-Var-3: ' . $_GET['var3'] . isset($_GET['var3']));
header('X-Var-4: ' . $_GET['var4'] . isset($_GET['var4']));
?>

View File

@@ -0,0 +1,5 @@
<?php
$body = file_get_contents('php://input');
header('Content-Length: ' . strlen($body));
echo $body;
?>

View File

@@ -0,0 +1,3 @@
<?php
phpinfo();
?>

View File

@@ -0,0 +1,6 @@
<?php
header('Content-Length: 0');
header('X-Var-1: ' . $_POST['var1']);
header('X-Var-2: ' . $_POST['var2'] . isset($_POST['var2']));
header('X-Var-3: ' . $_POST['var3'] . isset($_POST['var3']));
?>

View File

@@ -0,0 +1,13 @@
<?php
$body = file_get_contents('php://input');
header('Content-Length: ' . strlen($body));
header('Request-Method: ' . $_SERVER['REQUEST_METHOD']);
header('Request-Uri: ' . $_SERVER['REQUEST_URI']);
header('Http-Host: ' . $_SERVER['HTTP_HOST']);
header('Server-Protocol: ' . $_SERVER['SERVER_PROTOCOL']);
header('Server-Software: ' . $_SERVER['SERVER_SOFTWARE']);
header('Custom-Header: ' . $_SERVER['HTTP_CUSTOM_HEADER']);
echo $body;
?>