diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2017-02-15 20:33:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-15 20:33:05 +0100 |
commit | b1c4b445dac526f9eddc43bf6f4814e17a1a0726 (patch) | |
tree | 0d28f99ba12f30675accbaa9eaaf329a7969cada | |
parent | 17c07e5cafc6d562382217f4d2f67c20be325e4b (diff) | |
parent | 5acebb911be464c636fc7844f3048b65f9e6fefe (diff) | |
download | nextcloud-server-b1c4b445dac526f9eddc43bf6f4814e17a1a0726.tar.gz nextcloud-server-b1c4b445dac526f9eddc43bf6f4814e17a1a0726.zip |
Merge pull request #3449 from nextcloud/notify-subfolder-self-test
Make the notify self test for subfolders more reliable
-rw-r--r-- | apps/files_external/lib/Command/Notify.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/files_external/lib/Command/Notify.php b/apps/files_external/lib/Command/Notify.php index a55b16a45c4..6bb56373d33 100644 --- a/apps/files_external/lib/Command/Notify.php +++ b/apps/files_external/lib/Command/Notify.php @@ -184,19 +184,24 @@ class Notify extends Base { $storage->file_put_contents('/.nc_test_file.txt', 'test content'); $storage->mkdir('/.nc_test_folder'); $storage->file_put_contents('/.nc_test_folder/subfile.txt', 'test content'); + + usleep(100 * 1000); //time for all changes to be processed + $changes = $notifyHandler->getChanges(); + $storage->unlink('/.nc_test_file.txt'); $storage->unlink('/.nc_test_folder/subfile.txt'); $storage->rmdir('/.nc_test_folder'); + usleep(100 * 1000); //time for all changes to be processed + $notifyHandler->getChanges(); // flush $foundRootChange = false; $foundSubfolderChange = false; - $changes = $notifyHandler->getChanges(); foreach ($changes as $change) { - if ($change->getPath() === '/.nc_test_file.txt') { + if ($change->getPath() === '/.nc_test_file.txt' || $change->getPath() === '.nc_test_file.txt') { $foundRootChange = true; - } else if ($change->getPath() === '/.nc_test_folder/subfile.txt') { + } else if ($change->getPath() === '/.nc_test_folder/subfile.txt' || $change->getPath() === '.nc_test_folder/subfile.txt') { $foundSubfolderChange = true; } } |