()
| 88 | } |
| 89 | |
| 90 | public function testConnection(): bool |
| 91 | { |
| 92 | $status = $this->request('PROPFIND', $this->buildUrlForRelative(''), null, ['Depth' => '0']); |
| 93 | if ($status >= 200 && $status < 300) { |
| 94 | $this->lastError = ''; |
| 95 | return true; |
| 96 | } |
| 97 | if ($status === 401 || $status === 403) { |
| 98 | $this->lastError = 'Auth failed (HTTP ' . $status . ')'; |
| 99 | } elseif ($status > 0) { |
| 100 | $this->lastError = 'HTTP ' . $status; |
| 101 | } elseif ($this->lastError === '') { |
| 102 | $this->lastError = 'Connection failed'; |
| 103 | } |
| 104 | return false; |
| 105 | } |
| 106 | |
| 107 | public function getLastError(): string |
| 108 | { |
no test coverage detected