public function testSetBodyResource() { $handle = fopen('php://memory', 'r+'); fwrite($handle, 'foobar'); $message = new Message(array(), $handle); $this->assertEquals('foobar', (string) $message->getBody()); }