public function scanAll() { $data = $this->storage->getShareInfo(); if ($data['status'] === 'success') { $this->addResult($data['data'], ''); } else { throw new \Exception('Error while scanning remote share'); } }
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); }
/** * 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() . '"'); } }