Affects Version/s: None
Two issues here:
1. In the test "core_course_external_testcase::test_create_courses" there is a conditional test on L390 that checks completion_info::is_enabled_for_site().
Because PHPUnit pulls its config from the default for the setting (not from the site's config table) this branch is never executed even if you enable completion on the site you are testing. It will only run if you added "set_config('enablecompletion', 1);" in the test, or if you changed the enablecompletion default to 1 in admin/settings/subsystems.php.
2. If that branch of code was executed there is a bug, causing a test failure:
There was 1 error:
Undefined index: enabledcompletion
The issue is that the array key on L391 should be 'enablecompletion' not 'enabledcompletion'.
The fix for the 2nd problem is to correct the type in the array key. The 1st problem could be fixed by removing the if statement and the 'true' condition completely or by using set_config() and testing with and without completion enabled separately.