PhlyTest\Http\StreamTest::testAttachWithStringRepresentingResourceCreatesAndAttachesResource PHP Method

testAttachWithStringRepresentingResourceCreatesAndAttachesResource() public method

    public function testAttachWithStringRepresentingResourceCreatesAndAttachesResource()
    {
        $this->tmpnam = tempnam(sys_get_temp_dir(), 'PHLY');
        $this->stream->attach($this->tmpnam);
        $resource = fopen($this->tmpnam, 'r+');
        fwrite($resource, 'FooBar');
        $this->stream->rewind();
        $test = (string) $this->stream;
        $this->assertEquals('FooBar', $test);
    }
StreamTest