1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Files
archived-php-src/sapi/cli/tests/bug69655.phpt
Nikita Popov 6ab4e330ac Use ephemeral port in more server tests
Port the main php_cli_server.inc to use ephemeral ports, thus
allowing CLI server tests to be parallelized.

A complication here is that we also need to give each test a
separate doc root, to avoid index.php files writing over each
other.

Closes GH-6375.
2020-10-23 14:26:34 +02:00

28 lines
919 B
PHP

--TEST--
Bug #69655 (php -S changes MKCALENDAR request method to MKCOL)
--INI--
allow_url_fopen=1
--SKIPIF--
<?php
include "skipif.inc";
?>
--FILE--
<?php
include "php_cli_server.inc";
php_cli_server_start();
foreach (['MKCO', 'MKCOLL', 'M'] as $method) {
$context = stream_context_create(['http' => ['method' => $method]]);
// the following is supposed to emit a warning for unsupported methods
file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS, false, $context);
}
?>
--EXPECTF--
Warning: file_get_contents(http://localhost:%d): Failed to open stream: HTTP request failed! HTTP/1.1 501 Not Implemented
in %s on line %d
Warning: file_get_contents(http://localhost:%d): Failed to open stream: HTTP request failed! HTTP/1.1 501 Not Implemented
in %s on line %d
Warning: file_get_contents(http://localhost:%d): Failed to open stream: HTTP request failed! HTTP/1.1 501 Not Implemented
in %s on line %d