class UpdateCacheTest
Same name and namespace in other branches
- 11.x core/modules/system/tests/src/Functional/UpdateSystem/UpdateCacheTest.php \Drupal\Tests\system\Functional\UpdateSystem\UpdateCacheTest
- 10 core/modules/system/tests/src/Functional/UpdateSystem/UpdateCacheTest.php \Drupal\Tests\system\Functional\UpdateSystem\UpdateCacheTest
- 8.9.x core/modules/system/tests/src/Functional/UpdateSystem/UpdateCacheTest.php \Drupal\Tests\system\Functional\UpdateSystem\UpdateCacheTest
Tests caches during updates.
@group Update
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\system\Functional\UpdateSystem\UpdateCacheTest uses \Drupal\Tests\RequirementsPageTrait extends \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of UpdateCacheTest
File
-
core/
modules/ system/ tests/ src/ Functional/ UpdateSystem/ UpdateCacheTest.php, line 14
Namespace
Drupal\Tests\system\Functional\UpdateSystemView source
class UpdateCacheTest extends BrowserTestBase {
use RequirementsPageTrait;
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Tests that caches are cleared during updates.
*
* @see \Drupal\Core\Update\UpdateServiceProvider
* @see \Drupal\Core\Update\UpdateBackend
*/
public function testCaches() {
\Drupal::cache()->set('will_not_exist_after_update', TRUE);
// The site might be broken at the time so logging in using the UI might
// not work, so we use the API itself.
$this->writeSettings([
'settings' => [
'update_free_access' => (object) [
'value' => TRUE,
'required' => TRUE,
],
],
]);
// Clicking continue should clear the caches.
$this->drupalGet(Url::fromRoute('system.db_update', [], [
'path_processing' => FALSE,
]));
$this->updateRequirementsProblem();
$this->clickLink('Continue');
$this->assertFalse(\Drupal::cache()->get('will_not_exist_after_update', FALSE));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.