Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directory should not be allowed to move to itself #255

Open
mvorisek opened this issue May 28, 2021 · 0 comments
Open

Directory should not be allowed to move to itself #255

mvorisek opened this issue May 28, 2021 · 0 comments

Comments

@mvorisek
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant