o365-moodle
o365-moodle copied to clipboard
Unit test error in MOODLE_401_STABLE
Hi, I am getting this error when using MOODLE_401_STABLE branch.
vendor/bin/phpunit local/o365/tests/usersync_test.php
Moodle 4.1.9+ (Build: 20240326), 232ca3445eb811071467e892a261b624e371e9d4
Php: 8.1.27, pgsql: 14.0 (Debian 14.0-1.pgdg110+1), OS: Linux 6.5.0-26-generic x86_64
Class usersync_test could not be found in /var/www/m401hq/local/o365/tests/usersync_test.php
root@48fa47c3f169:/var/www/m401hq# vendor/bin/phpunit local/o365/tests/usersync_test.php
Moodle 4.1.9+ (Build: 20240326), 232ca3445eb811071467e892a261b624e371e9d4
Php: 8.1.27, pgsql: 14.0 (Debian 14.0-1.pgdg110+1), OS: Linux 6.5.0-26-generic x86_64
Class usersync_test could not be found in /var/www/m401hq/local/o365/tests/usersync_test.php
root@48fa47c3f169:/var/www/m401hq# vendor/bin/phpunit local/o365/tests/usersync_test.php
Moodle 4.1.9+ (Build: 20240326), 232ca3445eb811071467e892a261b624e371e9d4
Php: 8.1.27, pgsql: 14.0 (Debian 14.0-1.pgdg110+1), OS: Linux 6.5.0-26-generic x86_64
PHPUnit 9.5.28 by Sebastian Bergmann and contributors.
....E 5 / 5 (100%)
Time: 00:00.327, Memory: 68.50 MB
There was 1 error:
1) usersync_test::test_sync_users_create
Undefined array key "value"
/var/www/m401hq/local/o365/tests/usersync_test.php:306
/var/www/m401hq/lib/phpunit/classes/advanced_testcase.php:80
ERRORS!
Tests: 5, Assertions: 52, Errors: 1.
I feel we might be seeing something similar.
When going to "manage user connections" the user is listed, with "no connection" shown. If we try and match him we get the following. However theres no evidence of this when looking at any other user, unless I'm missing something. The users UPN hasn't changed, none of the usual things that cause problems.
This also affects MOODLE_403_STABLE but this is linked to the move from PHP8.0 -> PHP8.1
Hi all.
@CarlosArceLopera Thank you for reporting the issue and submitting the PR. I have reviewed the PR and it looks good to me. I'll include it in the next release.
The error is introduced as part of the attempt to optimise Graph API calls that returns paginated results. All actual calls to such Graph APIs are updated, but calls from unit test was missed.
@SYoung3000 what you experienced could well be a separate issue. Please report it separately and include more details (Moodle/plugin versions, steps to reproduce etc).
@aspark21 I don't think this is related to PHP version either. It would happen in all supported PHP versions.
Regards, Lai
Hi @CarlosArceLopera
The fix to the issue has been included in the release 4.1.7, 4.2.6 and 4.3.4 from today. Thank you again for reporting the issue and providing the solution.
I'll mark the issue as closed now.
Regards, Lai