
| Current Path : /var/www/html1/bbp/web/core/modules/system/tests/src/Functional/UpdateSystem/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html1/bbp/web/core/modules/system/tests/src/Functional/UpdateSystem/UpdateCacheTest.php |
<?php
namespace Drupal\Tests\system\Functional\UpdateSystem;
use Drupal\Core\Url;
use Drupal\Tests\BrowserTestBase;
use Drupal\Tests\RequirementsPageTrait;
/**
* Tests caches during updates.
*
* @group Update
*/
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(t('Continue'));
$this->assertFalse(\Drupal::cache()->get('will_not_exist_after_update', FALSE));
}
}