Пример #1
0
 /**
  * @dataProvider quotaChunkedFailProvider
  * @expectedException \Sabre\DAV\Exception\InsufficientStorage
  */
 public function testCheckQuotaChunkedFail($quota, $chunkTotalSize, $headers)
 {
     $this->init($quota, 'sub/test.txt');
     $mockChunking = $this->getMockBuilder('\\OC_FileChunking')->disableOriginalConstructor()->getMock();
     $mockChunking->expects($this->once())->method('getCurrentSize')->will($this->returnValue($chunkTotalSize));
     $this->plugin->expects($this->once())->method('getFileChunking')->will($this->returnValue($mockChunking));
     $headers['OC-CHUNKED'] = 1;
     $this->server->httpRequest = new \Sabre\HTTP\Request(null, null, $headers);
     $this->plugin->checkQuota('/sub/test.txt-chunking-12345-3-1');
 }
Пример #2
0
 /**
  * @expectedException \Sabre\DAV\Exception\InsufficientStorage
  * @dataProvider quotaExceededProvider
  */
 public function testCheckExceededQuota($quota, $headers)
 {
     $this->init($quota);
     $this->server->httpRequest = new \Sabre\HTTP\Request(null, null, $headers);
     $this->plugin->checkQuota('');
 }