Ejemplo n.º 1
0
 /**
  * @dataProvider downloadHeadersProvider
  */
 public function testDownloadHeaders($isClumsyAgent, $contentDispositionHeader)
 {
     $request = $this->getMockBuilder('Sabre\\HTTP\\RequestInterface')->disableOriginalConstructor()->getMock();
     $response = $this->getMockBuilder('Sabre\\HTTP\\ResponseInterface')->disableOriginalConstructor()->getMock();
     $request->expects($this->once())->method('getPath')->will($this->returnValue('test/somefile.xml'));
     $node = $this->getMockBuilder('\\OCA\\DAV\\Connector\\Sabre\\File')->disableOriginalConstructor()->getMock();
     $node->expects($this->once())->method('getName')->will($this->returnValue('somefile.xml'));
     $this->tree->expects($this->once())->method('getNodeForPath')->with('test/somefile.xml')->will($this->returnValue($node));
     $this->request->expects($this->once())->method('isUserAgent')->will($this->returnValue($isClumsyAgent));
     $response->expects($this->once())->method('addHeader')->with('Content-Disposition', $contentDispositionHeader);
     $this->plugin->httpGet($request, $response);
 }