public function testDetachResource() { $resource = fopen('php://memory', 'w+b'); $stream = new Stream($resource); $this->assertSame($stream->detach(), $resource); $this->assertNull($stream->getResource()); }