function DirectWriteTest::testDirectWriteFlagIsLocked

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

Tests that the sandbox's direct-write status is part of its locking info.

File

core/modules/package_manager/tests/src/Kernel/DirectWriteTest.php, line 232

Class

DirectWriteTest
Tests Direct Write.

Namespace

Drupal\Tests\package_manager\Kernel

Code

public function testDirectWriteFlagIsLocked() : void {
  $this->setSetting('package_manager_allow_direct_write', TRUE);
  $sandbox_manager = $this->createStage(TestDirectWriteSandboxManager::class);
  $this->assertTrue($sandbox_manager->isDirectWrite());
  $sandbox_manager->create();
  $this->setSetting('package_manager_allow_direct_write', FALSE);
  $this->assertTrue($sandbox_manager->isDirectWrite());
  // Only once the sandbox is destroyed should the sandbox manager reflect the
  // changed setting.
  $sandbox_manager->destroy();
  $this->assertFalse($sandbox_manager->isDirectWrite());
}

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