-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Filesystem] Add a failing test covering a bug in Filesystem::mirror()
#26399
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
Conversation
When calling `Filesystem::mirror()` with a `$iterator` parameter (to customize the list of files/folders to mirror), and when using the `delete` option on top of that, things break. This new test covers the problem (but do not fix it).
$this->assertTrue(is_dir($targetPath)); | ||
$this->assertDirectoryExists($targetPath.'source1'); | ||
$this->assertDirectoryNotExists($targetPath.'source2'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test works fine, I only wrote it because the $iterator
parameter is not covered at all by tests.
@@ -11,6 +11,8 @@ | |||
|
|||
namespace Symfony\Component\Filesystem\Tests; | |||
|
|||
use Symfony\Component\Finder\Finder; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up using the finder in the Filesystem component tests, is that OK? Should I add it to require-dev of the component I guess?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avoiding the finder dependency by using a native iterator would be best
@mnapoli up to work on a fix in this PR also? |
Unfortunately I'm completely swamped lately, I wish I could help more but I won't be able to (even though I'd really love a fix too ^^). I'm fine if you'd rather close this for now. |
Status: needs work |
Closing as we don't keep failing tests unless an implementation is planned. |
When calling
Filesystem::mirror()
with a$iterator
parameter (to customize the list of files/folders to mirror), and when using thedelete
option on top of that, things break.This new test covers the problem (but do not fix it). I have been scratching my head at it for an hour but I'm really having trouble with the implementation of
Filesystem::mirror()
.I believe the bug was introduced following #23473, more specifically:
Here is my debug session right before the exception:
Here are the values of the variables:
I'm out of ideas for tonight sorry! I don't know if PR with failing tests are useful at all? I won't mind if you close it.