Tests: initial PHP application tests.
This commit is contained in:
6
test/php/404/404.html
Normal file
6
test/php/404/404.html
Normal 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
4
test/php/404/index.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
http_response_code(404);
|
||||
include('404.html');
|
||||
?>
|
||||
5
test/php/conditional/index.php
Normal file
5
test/php/conditional/index.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php if ($_SERVER['REQUEST_METHOD'] === 'GET'): ?>
|
||||
True
|
||||
<?php else: ?>
|
||||
False
|
||||
<?php endif; ?>
|
||||
4
test/php/cookies/index.php
Normal file
4
test/php/cookies/index.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
header('X-Cookie-1: ' . $_COOKIE['var']);
|
||||
header('X-Cookie-2: ' . $_COOKIE['var2']);
|
||||
?>
|
||||
7
test/php/get_variables/index.php
Normal file
7
test/php/get_variables/index.php
Normal 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']));
|
||||
?>
|
||||
5
test/php/mirror/index.php
Normal file
5
test/php/mirror/index.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
$body = file_get_contents('php://input');
|
||||
header('Content-Length: ' . strlen($body));
|
||||
echo $body;
|
||||
?>
|
||||
3
test/php/phpinfo/index.php
Normal file
3
test/php/phpinfo/index.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
phpinfo();
|
||||
?>
|
||||
6
test/php/post_variables/index.php
Normal file
6
test/php/post_variables/index.php
Normal 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']));
|
||||
?>
|
||||
13
test/php/variables/index.php
Normal file
13
test/php/variables/index.php
Normal 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;
|
||||
?>
|
||||
Reference in New Issue
Block a user