function testDefaultInputStream() { $h = fopen('php://memory', 'r+'); fwrite($h, 'testing'); rewind($h); $previousValue = Request::$defaultInputStream; Request::$defaultInputStream = $h; $this->assertEquals('testing', $this->request->getBody(true), 'We didn\'t get our testbody back'); Request::$defaultInputStream = $previousValue; }
/** * HTTP REPORT method implementation * * Although the REPORT method is not part of the standard WebDAV spec (it's from rfc3253) * It's used in a lot of extensions, so it made sense to implement it into the core. * * @param string $uri * @return void */ protected function httpReport($uri) { $body = $this->httpRequest->getBody(true); $dom = XMLUtil::loadDOMDocument($body); $reportName = XMLUtil::toClarkNotation($dom->firstChild); if ($this->broadcastEvent('report', array($reportName, $dom, $uri))) { // If broadcastEvent returned true, it means the report was not supported throw new Exception\ReportNotSupported(); } }