예제 #1
0
 public function scanAll()
 {
     $data = $this->storage->getShareInfo();
     if ($data['status'] === 'success') {
         $this->addResult($data['data'], '');
     } else {
         throw new \Exception('Error while scanning remote share');
     }
 }
예제 #2
0
파일: scannertest.php 프로젝트: evanjt/core
 public function testScan()
 {
     $this->storage->expects($this->any())->method('getShareInfo')->willReturn(['status' => 'success', 'data' => []]);
     // FIXME add real tests, we are currently only checking for
     // Declaration of OCA\Files_Sharing\External\Scanner::*() should be
     // compatible with OC\Files\Cache\Scanner::*()
     $this->scanner->scan('test', Scanner::SCAN_RECURSIVE);
     $this->assertTrue(true);
 }
예제 #3
0
 /**
  * Checks the remote share for changes.
  * If changes are available, scan them and update
  * the cache.
  * @throws NotFoundException
  * @throws StorageInvalidException
  * @throws \Exception
  */
 public function scanAll()
 {
     try {
         $data = $this->storage->getShareInfo();
     } catch (\Exception $e) {
         $this->storage->checkStorageAvailability();
         throw new \Exception('Error while scanning remote share: "' . $this->storage->getRemote() . '" ' . $e->getMessage());
     }
     if ($data['status'] === 'success') {
         $this->addResult($data['data'], '');
     } else {
         throw new \Exception('Error while scanning remote share: "' . $this->storage->getRemote() . '"');
     }
 }