mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
handle error from non-empty folders in nativeshare
This commit is contained in:
parent
c63516eaed
commit
aaf2c049fd
2 changed files with 12 additions and 0 deletions
|
|
@ -11,6 +11,7 @@ use Icewind\SMB\Exception\AlreadyExistsException;
|
|||
use Icewind\SMB\Exception\Exception;
|
||||
use Icewind\SMB\Exception\ForbiddenException;
|
||||
use Icewind\SMB\Exception\InvalidTypeException;
|
||||
use Icewind\SMB\Exception\NotEmptyException;
|
||||
use Icewind\SMB\Exception\NotFoundException;
|
||||
|
||||
/**
|
||||
|
|
@ -42,6 +43,8 @@ class NativeState {
|
|||
throw new InvalidTypeException();
|
||||
case 21:
|
||||
throw new InvalidTypeException();
|
||||
case 39:
|
||||
throw new NotEmptyException();
|
||||
default:
|
||||
throw new Exception('Unknown error (' . $error . ')');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -281,6 +281,15 @@ abstract class AbstractShare extends \PHPUnit_Framework_TestCase {
|
|||
$this->share->del($this->root . '/foobar');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Icewind\SMB\Exception\NotEmptyException
|
||||
*/
|
||||
public function testRmdirNotEmpty() {
|
||||
$this->share->mkdir($this->root . '/foobar');
|
||||
$this->share->put($this->getTextFile(), $this->root . '/foobar/asd');
|
||||
$this->share->rmdir($this->root . '/foobar');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Icewind\SMB\Exception\NotFoundException
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue