Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
automatic_updates
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
automatic_updates
Commits
cadf0e46
Commit
cadf0e46
authored
2 years ago
by
Adam G-H
Browse files
Options
Downloads
Patches
Plain Diff
See if we can not break all kernel tests
parent
319ba7f3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/CronUpdater.php
+10
-1
10 additions, 1 deletion
src/CronUpdater.php
tests/src/Kernel/AutomaticUpdatesKernelTestBase.php
+8
-0
8 additions, 0 deletions
tests/src/Kernel/AutomaticUpdatesKernelTestBase.php
with
18 additions
and
1 deletion
src/CronUpdater.php
+
10
−
1
View file @
cadf0e46
...
@@ -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
;
}
}
}
}
This diff is collapsed.
Click to expand it.
tests/src/Kernel/AutomaticUpdatesKernelTestBase.php
+
8
−
0
View file @
cadf0e46
...
@@ -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
);
}
}
}
/**
/**
...
...
This diff is collapsed.
Click to expand it.
Adam G-H
@phenaproxima
mentioned in commit
876e0331
·
2 years ago
mentioned in commit
876e0331
mentioned in commit 876e0331a677b42b8a2a450d605342d86e21816a
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment