Verified Commit 8f625fbe authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3422495 by mondrake, smustgrave: Change...

Issue #3422495 by mondrake, smustgrave: Change DefaultConfigTest::moduleListDataProvider and helpers to static

(cherry picked from commit a293ccec)
parent 821bf8ad
Loading
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ class DefaultConfigTest extends KernelTestBase {
   *
   * @dataProvider moduleListDataProvider
   */
  public function testModuleConfig($module) {
  public function testModuleConfig(string $module): void {
    $this->assertExtensionConfig($module, 'module');
  }

@@ -171,8 +171,8 @@ public function themeListDataProvider() {
   *   An array of module names to test, with both key and value being the name
   *   of the module.
   */
  public function moduleListDataProvider() {
    $modules_keyed = $this->coreModuleListDataProvider();
  public static function moduleListDataProvider(): array {
    $modules_keyed = self::coreModuleListDataProvider();

    // Add a deprecated module with config.
    $modules_keyed['deprecated_module'] = ['deprecated_module'];
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ trait FileSystemModuleDiscoveryDataProviderTrait {
   * @return array
   *   An array of module names to test.
   */
  public function coreModuleListDataProvider() {
  public static function coreModuleListDataProvider(): array {
    $prefix = dirname(__DIR__, 3) . DIRECTORY_SEPARATOR . 'modules';
    $module_dirs = array_keys(iterator_to_array(new \FilesystemIterator($prefix)));
    $module_names = array_map(function ($path) use ($prefix) {