stream_get_contents
laravel/framework
Supported Versions: PHP 5, PHP 7, PHP 8
Reads remainder of a stream into a string
stream_get_contents
(
resource $stream
, ?
int $length
=
null
,
int $offset
= -
1
):
string
|
false
$this
->
factory
->
sink
(
$resource
)->
get
(
'https://example.com'
);
$this
->
assertSame
(
0
,
ftell
(
$resource
));
$this
->
assertSame
(
'abc123'
,
stream_get_contents
(
$resource
));
}
public function
testSinkWhenStubbedByPath
()
tests/Http/HttpClientTest.php
$this
->
factory
->
sink
(
$resource
)->
get
(
'http://foo.com/test'
);
$this
->
assertSame
(
json_encode
([
'page'
=>
'foo'
]),
stream_get_contents
(
$resource
));
}
public function
testCanAssertAgainstOrderOfHttpRequestsWithUrlStrings
()
tests/Http/HttpClientTest.php