diff --git a/core/modules/block/tests/src/Kernel/BlockDefinitionsTest.php b/core/modules/block/tests/src/Kernel/BlockDefinitionsTest.php index 4091b00..a97c3db 100644 --- a/core/modules/block/tests/src/Kernel/BlockDefinitionsTest.php +++ b/core/modules/block/tests/src/Kernel/BlockDefinitionsTest.php @@ -2,8 +2,8 @@ namespace Drupal\Tests\block\Kernel; -use Drupal\Core\Extension\ExtensionDiscovery; use Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery; +use Drupal\KernelTests\FileSystemModuleDiscoveryDataProviderTrait; use Drupal\KernelTests\KernelTestBase; /** @@ -13,21 +13,17 @@ */ class BlockDefinitionsTest extends KernelTestBase { + use FileSystemModuleDiscoveryDataProviderTrait; + /** * Tests that every block have a category. */ public function testBlockCategory() { // Get a list of all modules. - $listing = new ExtensionDiscovery(\Drupal::root()); - $module_list = $listing->scan('module'); - - // Filter out test modules. - $modules = array_filter(array_keys($module_list), function ($module) { - return !strstr($module, 'test'); - }); + $modules = $this->coreModuleListDataProvider(); // Load all modules so we can scan them for block plugins. - $this->enableModules($modules); + $this->enableModules(array_keys($modules)); // We use the AnnotatedClassDiscovery instead of the BlockManager so we can // check for empty categories before they are fill with the module's name.