mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
Additional test cases
This commit is contained in:
parent
f57f29d277
commit
69e9082def
3 changed files with 120 additions and 5 deletions
|
|
@ -29,6 +29,9 @@ class InvalidHostException extends \Exception {
|
|||
class AccessDeniedException extends \Exception {
|
||||
}
|
||||
|
||||
class InvalidTypeException extends \Exception {
|
||||
}
|
||||
|
||||
class ErrorCodes {
|
||||
/**
|
||||
* connection errors
|
||||
|
|
@ -44,4 +47,6 @@ class ErrorCodes {
|
|||
const NameCollision = 'NT_STATUS_OBJECT_NAME_COLLISION';
|
||||
const AccessDenied = 'NT_STATUS_ACCESS_DENIED';
|
||||
const DirectoryNotEmpty = 'NT_STATUS_DIRECTORY_NOT_EMPTY';
|
||||
const FileIsADirectory = 'NT_STATUS_FILE_IS_A_DIRECTORY';
|
||||
const NotADirectory = 'NT_STATUS_NOT_A_DIRECTORY';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -184,10 +184,11 @@ class Share {
|
|||
/**
|
||||
* @param $lines
|
||||
*
|
||||
* @throws \SMB\NotFoundException
|
||||
* @throws \SMB\AlreadyExistsException
|
||||
* @throws \SMB\AccessDeniedException
|
||||
* @throws \SMB\NotEmptyException
|
||||
* @throws NotFoundException
|
||||
* @throws AlreadyExistsException
|
||||
* @throws AccessDeniedException
|
||||
* @throws NotEmptyException
|
||||
* @throws InvalidTypeException
|
||||
* @throws \Exception
|
||||
* @return bool
|
||||
*/
|
||||
|
|
@ -210,6 +211,9 @@ class Share {
|
|||
throw new AccessDeniedException();
|
||||
case ErrorCodes::DirectoryNotEmpty:
|
||||
throw new NotEmptyException();
|
||||
case ErrorCodes::FileIsADirectory:
|
||||
case ErrorCodes::NotADirectory:
|
||||
throw new InvalidTypeException();
|
||||
default:
|
||||
throw new \Exception();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue