Reviewed & tested by the community
Project:
Universally Unique IDentifier
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
13 Jun 2019 at 19:43 UTC
Updated:
29 Mar 2023 at 14:36 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
andraeray commentedUpgraded info to add more details.
I'm curious, If an automated test is set up with php 7 will it show an error as well?
Comment #3
liam morlandDo you mean that you cannot get to
admin/config/development/testing?I am seeing this error message in automated testing failures for webform_validation. I don't see why because it doesn't depend on uuid_services.
Comment #4
andraeray commentedYea, I see the error when visiting the admin/config/development/testing page. I'm not sure why either. I had to comment out the test file in the uuid_services.info file.
Comment #5
camil.bancioiu commentedCan confirm.
PHP Fatal error: Class 'ServicesWebTestCase' not found in .../drupal/profiles/myprofile/modules/contrib/uuid/uuid_services/uuid_services.user_services.test on line 11Comment #6
hmdnawaz commentedCan Confirm!
I am also unable to to visit admin/config/development/testing due to this error.
Comment #7
vladsavitsky commentedSolutions:
1. Add 'services' module to system but it's huge.
2. Remove 'uuid_services' but it's a part of 'uuid' module.
3. Add 'tests/services.test' from 'services' module to 'uuid' module folder and add 'files[]=services.test' to uuid.info. It's not really a patch.
4. Remove 'files[]=uuid.test' string from 'uuid.info'. My choice.
Best solution - I think - is to separate 'uuid_services' from 'uuid'.
Comment #8
vladsavitsky commentedWrong file. Patch won't work.
Comment #9
vladsavitsky commentedPatch which disables tests in 'uuid_services'
Comment #10
hmdnawaz commentedThe question is the uuid_services module is disabled, then why Drupal searches for that missing class?
Comment #11
vladsavitsky commentedYes, 'uuid_services' is disabled. Seems simpletest searches all possible test cases.
UPD: I just rechecked. Module 'services' are missing in system. 'uuid_services' disabled (status = 0 in system table) and unistalled.
Comment #12
drupalgideon#7 I think you mean "4. Remove 'files[]=uuid_services.user_services.test' string from 'uuid_services.info'." That worked for me. I completely removed the line rather than commented it out.
I agree, however, with the best solution you mention - separate 'uuid_services' from 'uuid'.
Comment #13
liam morlandIf the reference to the test file is removed, how will it know about the test file?
Comment #14
liam morlandI think this is a bug in simpletest. It is executing files that are in the
filesentries in info files even if thedependenciesortest_dependencieslisted in that info file are not met.In this case, it is executing uuid_services.user_services.test, which tries to extend class ServicesWebTestCase which doesn't exist.
It should not do this. Simpletest should skip any info file that have unmet dependencies.
Comment #15
liam morlandComment #16
liam morlandIssue about solving this in core: #3078443: Do not test modules with unmet dependencies.
Comment #17
Delphine Lepers commentedI was working in the linked simpletest patch, and I investigated this issue a bit further. I noticed that i don't have errors in the console or in the testing page for other modules than uuid.
For example, metatag requires devel module to test, that does not throw an error in a instance where i don't have the module (of course if i run the test it will fail).
What i believe the issue is, is that the test uuid_services.test tries to load the missing class, when adding UUIDUserTestCase to the registry.
In order to avoid this, i suggest doing like drafty does here :
https://git.drupalcode.org/project/drafty/blob/7.x-1.x/tests/DraftyEntit...
This allows to run the test if you do have services (which patch #9 does not allow), and not register the useless class if you don't.
Comment #18
andras_szilagyi commented#17 works for me, tested under php version 7.1 and 7.2
Comment #19
donquixote commentedI just ran into this myself.
@Delphine (#17)
The patch does the job, it does prevent the error.
Explanation is spot on.
Some thoughts:
In general the idea with simpletest is to be able to run and discover tests even for modules that are not currently enabled.
So you should be able to run tests on a site where neither services nor uuid nor uuid_services is enabled.
It works like this:
- simpletest_registry_files_alter() adds test classes into the autoload registry for disabled modules.
- simpletest_test_get_all() looks into the registry AND scans the PSR-0 and PSR-4 directories for enabled and disabled modules.
The following is necessary for
ServicesWebTestCaseto be available, and the two tests to show up:-
servicesmodule package must be downloaded.- The registry must have been rebuilt since services was downloaded.
So
"have" really just means "have downloaded", not "have enabled".
So the comment is absolutely correct to not mention the word "enable" anywhere :)
So, +1 to the rtbc
Comment #20
donquixote commented@Liam Morland (#14)
Seems like a good plan, but perhaps we should already go ahead with the uuid patch, and not wait for core.
Comment #21
liam morlandI agree. This one is ready; the core patch is a ways off.
Comment #22
aubjr_drupal commentedSmall FYI: This same error also appears now in relation to fieldable_panels_panes tests.
PHP Fatal error: Class 'ServicesWebTestCase' not found in /home/local/eoss-migrate/profiles/openasu/modules/contrib/fieldable_panels_panes/tests/fpp.services.test on line 11 ...Comment #23
nelsongrin commentedThe patch provided on #17 works for me.
This will fix the tests on the following issue Support File entities and file, image and media fields.
Comment #24
puddyglumAre there any additional efforts that need to be completed before this can be committed?
Comment #25
puddyglumApplying patch #17 resolves broken tests for Course 7.x-2.x-dev. No observed issues.
Comment #26
djdevinFor now, to get around the issue with tests you can add uuid_services as a test dependency like so:
https://git.drupalcode.org/project/course/-/commit/a0ea59c925866d7f7c9f1...
Comment #27
summit commentedApplying patch #17 with only Drupal 7 core, simpletest and weblinks module gives still error:
How can I find out which module brings this fatal error please?
greetings,
Comment #28
Delphine Lepers commentedSearch your code for
extends ServicesWebTestCaseComment #29
summit commentedHi, with the search the modules: services and uuid are showing up. Thanks! How to proceed please?
In https://www.drupal.org/project/fieldable_panels_panes/issues/3107215
is stated:
Where do I start looking?
I also see https://www.drupal.org/project/services/issues/1441452 on drupal 6. Should that be a solution?
EDIT: I patched services with #17 and https://www.drupal.org/project/services/issues/1441452, but still same fatal error..
EDIT2 I patched services.info with https://git.drupalcode.org/project/course/-/commit/a0ea59c925866d7f7c9f1...
no solution also
When I am able to enable a module, all dependencies are set, right?
What can I do now please?
greetings,