Commit a40e3f8d authored by Project Update Bot's avatar Project Update Bot Committed by Andrii Podanenko
Browse files

Issue #3296833 by Project Update Bot: Automated Drupal 10 compatibility fixes

parent cfb82957
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

namespace Drupal\config_import;

use Drupal\Core\Site\Settings;
use Drupal\Core\File\FileSystemInterface;
use Drupal\Core\Config\CachedStorage;
use Drupal\Core\Config\ConfigImporterException;
@@ -170,7 +171,7 @@ class ConfigImporterService implements ConfigImporterServiceInterface {
    // @see https://www.drupal.org/node/2758325
    FileCacheFactory::setConfiguration([FileCacheFactory::DISABLE_CACHE => TRUE]);
    // Sync directory must be configured.
    $this->setDirectory(\Drupal\Core\Site\Settings::get('config_sync_directory') );
    $this->setDirectory(Settings::get('config_sync_directory') );
  }

  /**
+1 −1
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ class ConfigImporterServiceTest extends ConfigImporterServiceTestBase {
    // Remember the value before import which potentially can overwrite it.
    $original_value = $config_storage->read(static::TEST_CONFIG);
    // Set the directory to import configurations from.
    $this->configImporter->setDirectory(drupal_get_path('module', 'config_import') . '/tests/config/import');
    $this->configImporter->setDirectory(\Drupal::service('extension.list.module')->getPath('config_import') . '/tests/config/import');
    // Doing the import.
    $this->configImporter->importConfigs([static::TEST_CONFIG]);

+3 −3
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ abstract class ConfigImporterServiceTestBase extends KernelTestBase {
  /**
   * {@inheritdoc}
   */
  protected function setUp() {
  protected function setUp(): void {
    parent::setUp();

    $this->configImporter = $this->container->get('config_import.importer');
@@ -53,8 +53,8 @@ abstract class ConfigImporterServiceTestBase extends KernelTestBase {
    foreach ($arguments as $i => $argument) {
      $arguments[$i] = preg_quote($argument, '/');
    }

    $this->setExpectedExceptionRegExp($class, sprintf('/^%s$/', vsprintf($regex, $arguments)));
    $this->expectExceptionMessageMatches(sprintf('/^%s$/', vsprintf($regex, $arguments)));
    $this->expectException($class);
  }

  /**