1--TEST-- 2Digest Authentication 3--SKIPIF-- 4<?php 5include "skipif.inc"; 6?> 7--FILE-- 8<?php 9include "php_cli_server.inc"; 10php_cli_server_start('var_dump(!isset($_SERVER["PHP_AUTH_USER"]), !isset($_SERVER["PHP_AUTH_PW"]), $_SERVER["PHP_AUTH_DIGEST"]);'); 11 12$host = PHP_CLI_SERVER_HOSTNAME; 13$fp = php_cli_server_connect(); 14 15if(fwrite($fp, <<<HEADER 16GET / HTTP/1.1 17Host: {$host} 18Authorization: digest username="Mufasa", realm="testrealm@host.com", nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093", uri="/dir/index.html", qop=auth, nc=00000001, cnonce="0a4f113b", response="6629fae49393a05397450978507c4ef1", opaque="5ccc069c403ebaf9f0171e9517f40e41" 19 20 21HEADER 22)) { 23 fpassthru($fp); 24} 25 26?> 27--EXPECTF-- 28HTTP/1.1 200 OK 29Host: %s 30Date: %s 31Connection: close 32X-Powered-By: PHP/%s 33Content-type: text/html; charset=UTF-8 34 35bool(true) 36bool(true) 37string(242) "username="Mufasa", realm="testrealm@host.com", nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093", uri="/dir/index.html", qop=auth, nc=00000001, cnonce="0a4f113b", response="6629fae49393a05397450978507c4ef1", opaque="5ccc069c403ebaf9f0171e9517f40e41"" 38