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
a480092f
Commit
a480092f
authored
3 years ago
by
Kunal Sachdev
Committed by
Ted Bowman
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3243405
by kunal.sachdev: Add a kernel test of UpdateVersionValidator
parent
03831e0e
No related branches found
No related tags found
1 merge request
!80
Issue #3243405: Add a kernel test of UpdateVersionValidator
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/src/Kernel/ReadinessValidation/UpdateVersionValidatorTest.php
+49
-0
49 additions, 0 deletions
...Kernel/ReadinessValidation/UpdateVersionValidatorTest.php
with
49 additions
and
0 deletions
tests/src/Kernel/ReadinessValidation/UpdateVersionValidatorTest.php
0 → 100644
+
49
−
0
View file @
a480092f
<?php
namespace
Drupal\Tests\automatic_updates\Kernel\ReadinessValidation
;
use
Drupal\automatic_updates
\Validation\ValidationResult
;
use
Drupal\Tests\automatic_updates
\Kernel\AutomaticUpdatesKernelTestBase
;
/**
* @covers \Drupal\automatic_updates\Validator\UpdateVersionValidator
*
* @group automatic_updates
*/
class
UpdateVersionValidatorTest
extends
AutomaticUpdatesKernelTestBase
{
/**
* {@inheritdoc}
*/
protected
static
$modules
=
[
'automatic_updates'
,
'package_manager'
,
];
/**
* Tests an update version that is same major & minor version as the current.
*/
public
function
testNoMajorOrMinorUpdates
():
void
{
$this
->
assertCheckerResultsFromManager
([],
TRUE
);
}
/**
* Tests an update version that is a different major version than the current.
*/
public
function
testMajorUpdates
():
void
{
$this
->
setCoreVersion
(
'8.9.1'
);
$result
=
ValidationResult
::
createError
([
'Updating from one major version to another is not supported.'
]);
$this
->
assertCheckerResultsFromManager
([
$result
],
TRUE
);
}
/**
* Tests an update version that is a different minor version than the current.
*/
public
function
testMinorUpdates
():
void
{
$this
->
setCoreVersion
(
'9.7.1'
);
$result
=
ValidationResult
::
createError
([
'Updating from one minor version to another is not supported.'
]);
$this
->
assertCheckerResultsFromManager
([
$result
],
TRUE
);
}
}
This diff is collapsed.
Click to expand it.
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