mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
update rmdir test
This commit is contained in:
parent
02e848852f
commit
8d936e04ef
1 changed files with 16 additions and 5 deletions
|
|
@ -12,6 +12,7 @@ use Icewind\SMB\BasicAuth;
|
|||
use Icewind\SMB\Exception\AccessDeniedException;
|
||||
use Icewind\SMB\Exception\AlreadyExistsException;
|
||||
use Icewind\SMB\Exception\FileInUseException;
|
||||
use Icewind\SMB\Exception\ForbiddenException;
|
||||
use Icewind\SMB\Exception\InvalidPathException;
|
||||
use Icewind\SMB\Exception\InvalidResourceException;
|
||||
use Icewind\SMB\Exception\InvalidTypeException;
|
||||
|
|
@ -385,10 +386,14 @@ abstract class AbstractShareTest extends TestCase {
|
|||
}
|
||||
|
||||
public function testRmdirNotEmpty() {
|
||||
$this->expectException(NotEmptyException::class);
|
||||
$this->share->mkdir($this->root . '/foobar');
|
||||
$this->share->put($this->getTextFile(), $this->root . '/foobar/asd');
|
||||
try {
|
||||
$this->share->rmdir($this->root . '/foobar');
|
||||
$this->markTestSkipped("Old client versions don't throw this error");
|
||||
} catch (NotEmptyException $e) {
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -763,7 +768,6 @@ abstract class AbstractShareTest extends TestCase {
|
|||
}
|
||||
|
||||
public function testWrongUserName() {
|
||||
$this->expectException(AccessDeniedException::class);
|
||||
$serverClass = $this->getServerClass();
|
||||
$server = new $serverClass(
|
||||
$this->config->host,
|
||||
|
|
@ -776,7 +780,14 @@ abstract class AbstractShareTest extends TestCase {
|
|||
new TimeZoneProvider(new System()),
|
||||
new Options()
|
||||
);
|
||||
try {
|
||||
$share = $server->getShare($this->config->share);
|
||||
$share->dir("");
|
||||
$this->fail("Expected exception");
|
||||
} catch (AccessDeniedException $e) {
|
||||
$this->assertTrue(true);
|
||||
} catch (ForbiddenException $e) {
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue