Пример #1
0
 public function testListShares()
 {
     $shares = $this->server->listShares();
     foreach ($shares as $share) {
         if ($share->getName() === $this->config->share) {
             return;
         }
     }
     $this->fail('Share "' . $this->config->share . '" not found');
 }
Пример #2
0
 /**
  * @param bool $isPersonal
  * @return bool
  */
 public function test($isPersonal = true)
 {
     if ($isPersonal) {
         if ($this->stat('')) {
             return true;
         }
         return false;
     } else {
         $server = new Server($this->server->getHost(), '', '');
         try {
             $server->listShares();
             return true;
         } catch (AccessDeniedException $e) {
             // expected due to anonymous login
             return true;
         } catch (Exception $e) {
             return false;
         }
     }
 }