Skip to content
Snippets Groups Projects
Commit cadf0e46 authored by Adam G-H's avatar Adam G-H
Browse files

See if we can not break all kernel tests

parent 319ba7f3
No related branches found
No related tags found
No related merge requests found
...@@ -14,6 +14,15 @@ use Drupal\package_manager\Exception\StageValidationException; ...@@ -14,6 +14,15 @@ use Drupal\package_manager\Exception\StageValidationException;
*/ */
class CronUpdater extends Updater { class CronUpdater extends Updater {
/**
* Whether or not cron updates are hard-disabled.
*
* @var bool
*
* @todo Remove this when TUF integration is stable.
*/
private static $disabled = TRUE;
/** /**
* All automatic updates are disabled. * All automatic updates are disabled.
* *
...@@ -140,7 +149,7 @@ class CronUpdater extends Updater { ...@@ -140,7 +149,7 @@ class CronUpdater extends Updater {
* TRUE if cron updates are disabled, otherwise FALSE. * TRUE if cron updates are disabled, otherwise FALSE.
*/ */
private function isDisabled(): bool { private function isDisabled(): bool {
return $this->configFactory->get('automatic_updates.settings')->get('cron') === static::DISABLED; return self::$disabled ?: $this->configFactory->get('automatic_updates.settings')->get('cron') === static::DISABLED;
} }
} }
...@@ -68,6 +68,14 @@ abstract class AutomaticUpdatesKernelTestBase extends PackageManagerKernelTestBa ...@@ -68,6 +68,14 @@ abstract class AutomaticUpdatesKernelTestBase extends PackageManagerKernelTestBa
// from a sane state. // from a sane state.
// @see \Drupal\automatic_updates\Validator\CronFrequencyValidator // @see \Drupal\automatic_updates\Validator\CronFrequencyValidator
$this->container->get('state')->set('system.cron_last', time()); $this->container->get('state')->set('system.cron_last', time());
// @todo Remove this when TUF integration is stable.
if (class_exists(CronUpdater::class)) {
$reflector = new \ReflectionClass(CronUpdater::class);
$reflector = $reflector->getProperty('disabled');
$reflector->setAccessible(TRUE);
$reflector->setValue(NULL, FALSE);
}
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment