function SandboxManagerBaseTest::testStageDirectoryDeletedDuringCron

Tests that destroyed stage directories are actually deleted during cron.

@covers ::destroy
@covers \Drupal\package_manager\Plugin\QueueWorker\Cleaner

File

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

Class

SandboxManagerBaseTest
@coversDefaultClass \Drupal\package_manager\SandboxManagerBase[[api-linebreak]] @group package_manager @group #slow @internal

Namespace

Drupal\Tests\package_manager\Kernel

Code

public function testStageDirectoryDeletedDuringCron() : void {
  $stage = $this->createStage();
  $stage->create();
  $dir = $stage->getSandboxDirectory();
  $this->assertDirectoryExists($dir);
  $stage->destroy();
  // The stage directory should still exist, but the stage should be
  // available.
  $this->assertTrue($stage->isAvailable());
  $this->assertDirectoryExists($dir);
  $this->container
    ->get('cron')
    ->run();
  $this->assertDirectoryDoesNotExist($dir);
}

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