mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
Add proper exception for moving a folder into itself
This commit is contained in:
parent
1f650a5fbf
commit
fb98c1cd25
3 changed files with 22 additions and 1 deletions
10
src/Exception/InvalidArgumentException.php
Normal file
10
src/Exception/InvalidArgumentException.php
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* Copyright (c) 2014 Robin Appelman <icewind@owncloud.com>
|
||||
* This file is licensed under the Licensed under the MIT license:
|
||||
* http://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
namespace Icewind\SMB\Exception;
|
||||
|
||||
class InvalidArgumentException extends InvalidRequestException {}
|
||||
|
|
@ -28,9 +28,11 @@ class NativeState {
|
|||
1 => '\Icewind\SMB\Exception\ForbiddenException',
|
||||
2 => '\Icewind\SMB\Exception\NotFoundException',
|
||||
13 => '\Icewind\SMB\Exception\ForbiddenException',
|
||||
16 => '\Icewind\SMB\Exception\FileInUseException',
|
||||
17 => '\Icewind\SMB\Exception\AlreadyExistsException',
|
||||
20 => '\Icewind\SMB\Exception\InvalidTypeException',
|
||||
21 => '\Icewind\SMB\Exception\InvalidTypeException',
|
||||
22 => '\Icewind\SMB\Exception\InvalidArgumentException',
|
||||
28 => '\Icewind\SMB\Exception\OutOfSpaceException',
|
||||
39 => '\Icewind\SMB\Exception\NotEmptyException',
|
||||
110 => '\Icewind\SMB\Exception\TimedOutException',
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
namespace Icewind\SMB\Test;
|
||||
|
||||
use Icewind\SMB\Exception\FileInUseException;
|
||||
use Icewind\SMB\Exception\InvalidPathException;
|
||||
use Icewind\SMB\Exception\NotFoundException;
|
||||
use Icewind\SMB\FileInfo;
|
||||
|
|
@ -670,4 +671,12 @@ abstract class AbstractShare extends TestCase {
|
|||
$info = $this->share->stat('/');
|
||||
$this->assertInstanceOf('\Icewind\SMB\IFileInfo', $info);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Icewind\SMB\Exception\FileInUseException
|
||||
*/
|
||||
public function testMoveIntoSelf() {
|
||||
$this->share->mkdir($this->root . '/folder');
|
||||
$this->share->rename($this->root . '/folder', $this->root . '/folder/subfolder');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue