Problem/Motivation
#2325197: Remove drupal_classloader() changed how the class loader works in DrupalKernel. This also needs to be done to TestKernel
Proposed resolution
Replicate the changes to DrupalKernel in TestKernel.
Remaining tasks
User interface changes
None.
API changes
None, though the type signature of TestKernel will remove the type hint for the $class_loader parameter.
Original report by @username
There is a type mismatch TestKernel and DrupalKernel for the createFromRequest method.
DrupalKernel:
public static function createFromRequest(Request $request, $class_loader, $environment, $allow_dumping = TRUE) { ... }
TestKernel:
public static function createFromRequest(Request $request, ClassLoader $class_loader, $environment, $allow_dumping = TRUE) { ... }
This causes problems when running some tests under PHP 5.5. For example, SimpleTestBrowserTest fails with PHP 5.5 IN HEAD. It passes when you add the proper type hint to DrupalKernel::createFromRequest().
Comments
Comment #1
mpdonadioPatch with type hint added to DrupalKernel::createFromRequest()
Comment #2
mpdonadioSaw the related issue after I attached the patch. I'll take care of this.
Comment #3
mpdonadioSince TestKernel just has one method that essentially just wraps DrupalKernel::createFromRequest(), I don't see what else needs to be done here. All tests with Kernel in the name and SimpleTestBrowserTest pass locally for me in PHP 5.5.
Comment #4
znerol commented#3 is correct. Please also remove the use statement on line 12.
Comment #5
mpdonadioDouble checked all of the Kernel tests and SimpleTestBrowserTest locally.
Comment #6
znerol commentedThank you.
Comment #7
tstoecklerAwesome, thanks!
Adding related issue.
Comment #8
alexpottThis issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per #2350615: [policy, no patch] What changes can be accepted during the Drupal 8 beta phase?. Committed d3b5655 and pushed to 8.0.x. Thanks!
Comment #11
mpdonadioCleaning up the issues that I am assigned to...