function SandboxManagerBaseTest::testConfigChangeNoOpWithoutSandboxDirectory

Same name and namespace in other branches
  1. 11.x core/modules/package_manager/tests/src/Kernel/SandboxManagerBaseTest.php \Drupal\Tests\package_manager\Kernel\SandboxManagerBaseTest::testConfigChangeNoOpWithoutSandboxDirectory()

Tests that config change is a no-op when no sandbox directory exists.

When 'include_unknown_files_in_project_root' is changed to FALSE but no sandbox directory exists on disk, the subscriber should do nothing.

@legacy-covers \Drupal\package_manager\EventSubscriber\LongLivedSandboxSubscriber

File

core/modules/package_manager/tests/src/Kernel/SandboxManagerBaseTest.php, line 733

Class

SandboxManagerBaseTest
Tests Drupal\package_manager\SandboxManagerBase.

Namespace

Drupal\Tests\package_manager\Kernel

Code

public function testConfigChangeNoOpWithoutSandboxDirectory() : void {
  $stage = $this->createStage();
  $dir = $stage->getSandboxDirectory();
  // Verify no sandbox directory exists on disk.
  $this->assertDirectoryDoesNotExist($dir);
  // Changing the config setting should not cause any errors.
  $config = $this->config('package_manager.settings');
  $config->set('include_unknown_files_in_project_root', TRUE)
    ->save();
  $config->set('include_unknown_files_in_project_root', FALSE)
    ->save();
  // Still no directory and no errors.
  $this->assertDirectoryDoesNotExist($dir);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.