You are here

public function ConfigImporterServiceTest::testSetDirectoryNotExists in Config Importer and Tools 8

Same name and namespace in other branches
  1. 8.2 tests/src/Unit/ConfigImporterServiceTest.php \Drupal\Tests\config_import\Unit\ConfigImporterServiceTest::testSetDirectoryNotExists()

Check that configuration directory physically exists.

Parameters

string $type: Type of configuration directory.

File

tests/src/Unit/ConfigImporterServiceTest.php, line 40

Class

ConfigImporterServiceTest
Testing configuration importer service.

Namespace

Drupal\Tests\config_import\Unit

Code

public function testSetDirectoryNotExists($type = 'something') {
  $GLOBALS['config_directories'][$type] = "/path/to/{$type}/not-exists";
  $this
    ->expectException(\InvalidArgumentException::class, '%s - is not valid path or type of directory with configurations\\.', $GLOBALS['config_directories'][$type]);
  $this->configImporter
    ->setDirectory($type);
}