stream_get_contents

Supported Versions: PHP 5, PHP 7, PHP 8
Reads remainder of a stream into a string
stream_get_contents(resource $stream, ?int $length nullint $offset = -1): string|false
        $this->factory->sink($resource)->get('https://example.com');



        
$this->assertSame(0ftell($resource));

        
$this->assertSame('abc123'stream_get_contents($resource));

    }



    public function 
testSinkWhenStubbedByPath()
        $this->factory->sink($resource)->get('http://foo.com/test');



        
$this->assertSame(json_encode(['page' => 'foo']), stream_get_contents($resource));

    }



    public function 
testCanAssertAgainstOrderOfHttpRequestsWithUrlStrings()