public function testCannotRetrieveStreamAfterMove() { $stream = new Stream('php://temp', 'wb+'); $stream->write('Foo bar!'); $upload = new UploadedFile($stream, 0, UPLOAD_ERR_OK); $this->tmpFile = $to = tempnam(sys_get_temp_dir(), 'phly'); $upload->moveTo($to); $this->assertTrue(file_exists($to)); $this->setExpectedException('RuntimeException', 'moved'); $upload->getStream(); }