Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
#2786583: Create a base class for DateTimeFieldTest and DateRangeFieldTest and move common code into it inadvertently coupled datetime.module to datetime_range.module
Proposed resolution
Change Item class.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#2 | 2859013-02.patch | 1.02 KB | mpdonadio |
Comments
Comment #2
mpdonadioComment #3
mpdonadioThe more I look at this, the more confused I am. If datetime_range.module is not enabled, why is the autoloader finding the DateRangeItem class?
Comment #4
jhedstromI wonder if the autoloader works differently when tests are running, or something like that?
Regardless, this is a clear bug and a very easy fix.
Comment #5
xjmLet's just make sure it actually is working in light of the autoloader/module enabled thing. I wouldn't be surprised if this was different in tests but just to make sure.
Comment #7
mpdonadio@tim.plunkett helped me understand this. In Drupal\simpletest\TestDiscovery::registerTestNamespaces() we have
I believe this is so that a class in a test can be resolved properly with the autoloader before the setUp() enables it.
Comment #8
xjmAh, #7 totally makes sense!
#5 has fewer fails than I was expecting, but does still prove it's actually being used.
Comment #11
xjmCommitted to 8.4.x, thanks! I also cherry-picked it to 8.3.x as a test coverage fix.