vfsStream icon indicating copy to clipboard operation
vfsStream copied to clipboard

Directory should not be allowed to move to itself

Open mvorisek opened this issue 4 years ago • 0 comments

Code to reproduce:

use org\bovigo\vfs\vfsStream;

$root = vfsStream::setup('x');

var_dump($root->url());
// var_dump(unlink($root->url())); // exception is thrown - correct: Operation not permitted
// var_dump(rename($root->url(), $root->url() . '/a/a')); // exception is thrown - correct: No such file or directory
var_dump(rename($root->url(), $root->url() . '/b')); // no exception, but it is wrong - directory can not be moved to itself
var_dump($root->url());
var_dump(is_dir($root->url()));

Current output:

string(7) "vfs://x"
bool(true)
string(9) "vfs://b/b"
bool(false)

Expected output:

string(7) "vfs://x"
exception

mvorisek avatar May 28 '21 16:05 mvorisek