Hello everyone
I am testing the groupfolder apps to offer groupfolder’s developers a enhancement. For my tests, I use this app (groupfolder) in my local machine and on one server. I am testing on both.
Before to modif the code of groupfolders app, I am testing with units test.
But I have encountered a problem when I launch this command on my local machine and server since last friday.
./vendor/bin/phpunit tests/Folder/FolderManagerTest.php
Here is the result on both enviromnents :
PHPUnit 8.5.14 by Sebastian Bergmann and contributors.
EEEEEEEEEEEEE 13 / 13 (100%)
Time: 402 ms, Memory: 4.00 MB
There were 13 errors:
1) OCA\GroupFolders\Tests\Folder\FolderManagerTest::testCreateFolder
Error: Class 'OC' not found
/var/www/html/nextcloud/dev-nc20.test.arawa.fr/apps/groupfolders/tests/Folder/FolderManagerTest.php:52
2) OCA\GroupFolders\Tests\Folder\FolderManagerTest::testSetMountpoint
Error: Class 'OC' not found
/var/www/html/nextcloud/dev-nc20.test.arawa.fr/apps/groupfolders/tests/Folder/FolderManagerTest.php:52
3) OCA\GroupFolders\Tests\Folder\FolderManagerTest::testAddApplicable
Error: Class 'OC' not found
/var/www/html/nextcloud/dev-nc20.test.arawa.fr/apps/groupfolders/tests/Folder/FolderManagerTest.php:52
4) OCA\GroupFolders\Tests\Folder\FolderManagerTest::testSetPermissions
Error: Class 'OC' not found
/var/www/html/nextcloud/dev-nc20.test.arawa.fr/apps/groupfolders/tests/Folder/FolderManagerTest.php:52
5) OCA\GroupFolders\Tests\Folder\FolderManagerTest::testRemoveApplicable
Error: Class 'OC' not found
/var/www/html/nextcloud/dev-nc20.test.arawa.fr/apps/groupfolders/tests/Folder/FolderManagerTest.php:52
6) OCA\GroupFolders\Tests\Folder\FolderManagerTest::testRemoveFolder
Error: Class 'OC' not found
/var/www/html/nextcloud/dev-nc20.test.arawa.fr/apps/groupfolders/tests/Folder/FolderManagerTest.php:52
7) OCA\GroupFolders\Tests\Folder\FolderManagerTest::testRenameFolder
Error: Class 'OC' not found
/var/www/html/nextcloud/dev-nc20.test.arawa.fr/apps/groupfolders/tests/Folder/FolderManagerTest.php:52
8) OCA\GroupFolders\Tests\Folder\FolderManagerTest::testSetACL
Error: Class 'OC' not found
/var/www/html/nextcloud/dev-nc20.test.arawa.fr/apps/groupfolders/tests/Folder/FolderManagerTest.php:52
9) OCA\GroupFolders\Tests\Folder\FolderManagerTest::testGetFoldersForGroup
Error: Class 'OC' not found
/var/www/html/nextcloud/dev-nc20.test.arawa.fr/apps/groupfolders/tests/Folder/FolderManagerTest.php:52
10) OCA\GroupFolders\Tests\Folder\FolderManagerTest::testGetFoldersForGroups
Error: Class 'OC' not found
/var/www/html/nextcloud/dev-nc20.test.arawa.fr/apps/groupfolders/tests/Folder/FolderManagerTest.php:52
11) OCA\GroupFolders\Tests\Folder\FolderManagerTest::testGetFoldersForUserEmpty
Error: Class 'OC' not found
/var/www/html/nextcloud/dev-nc20.test.arawa.fr/apps/groupfolders/tests/Folder/FolderManagerTest.php:52
12) OCA\GroupFolders\Tests\Folder\FolderManagerTest::testGetFoldersForUserSimple
Error: Class 'OC' not found
/var/www/html/nextcloud/dev-nc20.test.arawa.fr/apps/groupfolders/tests/Folder/FolderManagerTest.php:52
13) OCA\GroupFolders\Tests\Folder\FolderManagerTest::testGetFoldersForUserMerge
Error: Class 'OC' not found
/var/www/html/nextcloud/dev-nc20.test.arawa.fr/apps/groupfolders/tests/Folder/FolderManagerTest.php:52
ERRORS!
Tests: 13, Assertions: 0, Errors: 13.
I don’t know where is the problem ? How to run units test of one application ?
I know the OC
namespace is in the nextcloud/server
repository. So I understand why it doesn’t work on my local machine but I don’t understand on the server.
What is more, I created one issue on this problem : How I run tests on my local machine ? · Issue #1299 · nextcloud/groupfolders · GitHub .
What is more, I modified the composer file adding the autoload :
// ...
"autoload": {
"psr-4": {
"OCA\\GroupFolders\\": "lib/",
"OCP\\": "vendor/christophwurst/nextcloud/OCP"
}
},
//...
I don’t know if I can add the psr-4
to autoload classes (?)
I don’t know where can I ask for help, so I am sorry in advance ^^’