File: PsrHttpServerRequestHandlerInterface.phpt

package info (click to toggle)
php-psr 1.2.0-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 548 kB
  • sloc: ansic: 1,485; pascal: 203; xml: 150; makefile: 2
file content (27 lines) | stat: -rw-r--r-- 926 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--TEST--
Psr\Http\Server\RequestHandlerInterface
--SKIPIF--
<?php include('skip.inc'); ?>
--FILE--
<?php
include __DIR__ . '/SampleMessage.inc';
include __DIR__ . '/SampleRequest.inc';
include __DIR__ . '/SampleServerRequest.inc';
include __DIR__ . '/SampleResponse.inc';
include __DIR__ . '/SampleRequestHandler.inc';
var_dump(interface_exists('\\Psr\\Http\\Server\\RequestHandlerInterface', false));
var_dump(class_implements('SampleRequestHandler', false));
$request = new SampleServerRequest();
var_dump($request instanceof \Psr\Http\Message\ServerRequestInterface);
$handler = new SampleRequestHandler();
$response = $handler->handle($request);
var_dump($response instanceof \Psr\Http\Message\ResponseInterface);
--EXPECT--
bool(true)
array(1) {
  ["PsrExt\Http\Server\RequestHandlerInterface"]=>
  string(42) "PsrExt\Http\Server\RequestHandlerInterface"
}
bool(true)
string(28) "SampleRequestHandler::handle"
bool(true)