File: PsrHttpMessageStreamInterface.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 (49 lines) | stat: -rw-r--r-- 1,249 bytes parent folder | download | duplicates (3)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
--TEST--
Psr\Http\Message\StreamInterface
--SKIPIF--
<?php include('skip.inc'); ?>
--FILE--
<?php
use Psr\Http\Message\StreamInterface;
include __DIR__ . '/SampleStream.inc';
var_dump(interface_exists(StreamInterface::class, false));
var_dump(is_subclass_of(SampleStream::class, StreamInterface::class));
$stream = new SampleStream();
$stream->__toString();
$stream->close();
$stream->detach();
$stream->getSize();
$stream->tell();
$stream->eof();
$stream->isSeekable();
$stream->seek(0);
$stream->rewind();
$stream->isWritable();
$stream->write('foo');
$stream->isReadable();
$stream->read(123);
$stream->getContents();
$stream->getMetadata();
--EXPECTF--
bool(true)
bool(true)
string(24) "SampleStream::__toString"
string(19) "SampleStream::close"
string(20) "SampleStream::detach"
string(21) "SampleStream::getSize"
string(18) "SampleStream::tell"
string(17) "SampleStream::eof"
string(24) "SampleStream::isSeekable"
string(18) "SampleStream::seek"
int(0)
int(0)
string(20) "SampleStream::rewind"
string(24) "SampleStream::isWritable"
string(19) "SampleStream::write"
string(3) "foo"
string(24) "SampleStream::isReadable"
string(18) "SampleStream::read"
int(123)
string(25) "SampleStream::getContents"
string(25) "SampleStream::getMetadata"
NULL