File: PsrHttpMessageResponseInterface.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 (31 lines) | stat: -rw-r--r-- 1,035 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
28
29
30
31
--TEST--
Psr\Http\Message\ResponseInterface
--SKIPIF--
<?php include('skip.inc'); ?>
--FILE--
<?php
include __DIR__ . '/SampleMessage.inc';
include __DIR__ . '/SampleResponse.inc';
var_dump(interface_exists('\\Psr\\Http\\Message\\ResponseInterface', false));
var_dump(is_subclass_of('\\Psr\\Http\\Message\\ResponseInterface', '\\Psr\\Http\\Message\\MessageInterface'));
var_dump(class_implements('SampleResponse', false));
$request = new SampleResponse();
var_dump($request instanceof \Psr\Http\Message\MessageInterface);
$request->getStatusCode();
$request->withStatus(400, 'BAD REQUEST');
$request->getReasonPhrase();
--EXPECT--
bool(true)
bool(true)
array(2) {
  ["PsrExt\Http\Message\MessageInterface"]=>
  string(36) "PsrExt\Http\Message\MessageInterface"
  ["PsrExt\Http\Message\ResponseInterface"]=>
  string(37) "PsrExt\Http\Message\ResponseInterface"
}
bool(true)
string(29) "SampleResponse::getStatusCode"
string(26) "SampleResponse::withStatus"
int(400)
string(11) "BAD REQUEST"
string(31) "SampleResponse::getReasonPhrase"