Make the notify self test for subfolders more reliable

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2017-02-10 17:38:29 +01:00
parent b4ade76665
commit d9a6353bc1
No known key found for this signature in database
GPG key ID: CBCA68FBAEBF98C9

View file

@ -184,15 +184,20 @@ 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') {
$foundRootChange = true;