--TEST-- Psr\Http\Message\StreamFactoryInterface --SKIPIF-- --FILE-- createStream(); var_dump($stream instanceof \Psr\Http\Message\StreamInterface); $factory->createStream('content'); $stream = $factory->createStreamFromFile('/tmp/file1'); var_dump($stream instanceof \Psr\Http\Message\StreamInterface); $factory->createStreamFromFile('/tmp/file2', 'wb'); $stream = $factory->createStreamFromResource(fopen('php://memory', 'r')); var_dump($stream instanceof \Psr\Http\Message\StreamInterface); --EXPECTF-- bool(true) array(1) { ["PsrExt\Http\Message\StreamFactoryInterface"]=> string(42) "PsrExt\Http\Message\StreamFactoryInterface" } string(33) "SampleStreamFactory::createStream" string(0) "" bool(true) string(33) "SampleStreamFactory::createStream" string(7) "content" string(41) "SampleStreamFactory::createStreamFromFile" string(10) "/tmp/file1" string(1) "r" bool(true) string(41) "SampleStreamFactory::createStreamFromFile" string(10) "/tmp/file2" string(2) "wb" string(45) "SampleStreamFactory::createStreamFromResource" resource(%d) of type (stream) bool(true)