You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public function testLoadInclude() {
$module_handler = $this->getModuleHandler();
// Include exists.
$this->assertEquals(__DIR__ . '/modules/module_handler_test/hook_include.inc', $module_handler->loadInclude('module_handler_test', 'inc', 'hook_include'));
$this->assertTrue(function_exists('module_handler_test_hook_include'));
The module is in core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test/hook_include.inc. I'm guessing modules in this location aren't discovered by the test extension discovery.
// Register entity_test text field.
$this->container->get('module_handler')->loadInclude('entity_test', 'install');
In core/tests/Drupal/KernelTests/Core/Field/FieldAccessTest.php seems like a weird failure:
------ --------------------------------------------------------------
Line core/tests/Drupal/KernelTests/Core/Field/FieldAccessTest.php
------ --------------------------------------------------------------
60 A file could not be loaded from
Drupal\Core\Extension\ModuleHandlerInterface::loadInclude
------ --------------------------------------------------------------
The list of "known modules" for this check has nothing to do with the module handler instance used in that test.
There is a registry of modules somewhere..
And it seems none of the test modules is included.
I didn't forget about this. I just am waiting for time to figure out the "regression" for that unit test. The module inside of core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test (source) isn't discoverable even with test discovery enabled.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Direction is wrong.
As a test case you can use something like this:
I have not looked deeply into your package so I just post this code here instead of actually writing a test :)