Thanks for the latest security release.

One strange thing happens though, after upgrading to 7.x-1.3 I cannot access the drupal testing page while using php 7.0.33. It gives me a fatal error.

( ! ) Fatal error: Class 'ServicesWebTestCase' not found in C:\mysite\sites\all\modules\uuid\uuid_services\uuid_services.user_services.test on line 11

Please let me know if you need more details.

Comments

AndraeRay created an issue. See original summary.

andraeray’s picture

Title: Blank white screen when visiting drupal testing page » Fatal error: Class 'ServicesWebTestCase' not found when visiting drupal testing page
Issue summary: View changes

Upgraded 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?

liam morland’s picture

Do 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.

andraeray’s picture

Yea, 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.

camil.bancioiu’s picture

Can confirm.

PHP Fatal error: Class 'ServicesWebTestCase' not found in .../drupal/profiles/myprofile/modules/contrib/uuid/uuid_services/uuid_services.user_services.test on line 11

hmdnawaz’s picture

Can Confirm!

I am also unable to to visit admin/config/development/testing due to this error.

vladsavitsky’s picture

Solutions:
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'.

vladsavitsky’s picture

Wrong file. Patch won't work.

vladsavitsky’s picture

StatusFileSize
new520 bytes

Patch which disables tests in 'uuid_services'

hmdnawaz’s picture

The question is the uuid_services module is disabled, then why Drupal searches for that missing class?

vladsavitsky’s picture

Yes, '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.

drupalgideon’s picture

#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'.

liam morland’s picture

Version: 7.x-1.3 » 7.x-1.x-dev

If the reference to the test file is removed, how will it know about the test file?

liam morland’s picture

I think this is a bug in simpletest. It is executing files that are in the files entries in info files even if the dependencies or test_dependencies listed 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.

liam morland’s picture

liam morland’s picture

Delphine Lepers’s picture

I 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.

andras_szilagyi’s picture

Status: Active » Reviewed & tested by the community

#17 works for me, tested under php version 7.1 and 7.2

donquixote’s picture

I 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 ServicesWebTestCase to be available, and the two tests to show up:
- services module package must be downloaded.
- The registry must have been rebuilt since services was downloaded.

So

if you do have services

"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

donquixote’s picture

@Liam Morland (#14)

I think this is a bug in simpletest. It is executing files that are in the files entries in info files even if the dependencies or test_dependencies listed in that info file are not met.

Seems like a good plan, but perhaps we should already go ahead with the uuid patch, and not wait for core.

liam morland’s picture

I agree. This one is ready; the core patch is a ways off.

aubjr_drupal’s picture

Small 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 ...

nelsongrin’s picture

The 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.

puddyglum’s picture

Are there any additional efforts that need to be completed before this can be committed?

puddyglum’s picture

Applying patch #17 resolves broken tests for Course 7.x-2.x-dev. No observed issues.

djdevin’s picture

For 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...

summit’s picture

Applying patch #17 with only Drupal 7 core, simpletest and weblinks module gives still error:

Fatal error: Declaration of UuidUserServicesTest::setUp() must be compatible with ServicesWebTestCase::setUp(array $modules = []) in drupal7test/drupal7/web/sites/all/modules/uuid/uuid_services/uuid_services.user_services.test on line 39

How can I find out which module brings this fatal error please?

greetings,

Delphine Lepers’s picture

Search your code for extends ServicesWebTestCase

summit’s picture

Hi, 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:

If you're going to run all of the tests you need to also download all of the test dependencies too, please see the module's info file for details. 

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,