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
Merge requests
!199
Issue
#3262587
: Show warnings when starting an update
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Issue
#3262587
: Show warnings when starting an update
issue/automatic_updates-3262587:3262587-show-warnings-when
into
8.x-2.x
Overview
2
Commits
9
Pipelines
0
Changes
1
1 unresolved thread
Hide all comments
Merged
Adam G-H
requested to merge
issue/automatic_updates-3262587:3262587-show-warnings-when
into
8.x-2.x
3 years ago
Overview
2
Commits
9
Pipelines
0
Changes
1
1 unresolved thread
Hide all comments
Expand
0
0
Merge request reports
Viewing commit
8eed3813
Prev
Next
Show latest version
1 file
+
40
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
8eed3813
Start a unit test
· 8eed3813
Adam G-H
authored
3 years ago
tests/src/Unit/ReadinessTraitTest.php
0 → 100644
+
40
−
0
Options
<?php
namespace
Drupal\Tests\automatic_updates\Unit
;
use
Drupal\automatic_updates
\Validation\ReadinessTrait
;
use
Drupal\package_manager
\ValidationResult
;
use
Drupal\system\SystemManager
;
use
Drupal\Tests\UnitTestCase
;
/**
* @coversDefaultClass \Drupal\automatic_updates\Validation\ReadinessTrait
*
* @group automatic_updates
*/
class
ReadinessTraitTest
extends
UnitTestCase
{
use
ReadinessTrait
;
/**
* @covers ::getOverallSeverity
*/
public
function
testOverallSeverity
():
void
{
// An error and a warning should be counted as an error.
$results
=
[
ValidationResult
::
createError
([
'Boo!'
]),
ValidationResult
::
createWarning
([
'Moo!'
]),
];
$this
->
assertSame
(
SystemManager
::
REQUIREMENT_ERROR
,
$this
->
getOverallSeverity
(
$results
));
// If there are no results, but no errors, the results should be counted as
// a warning.
array_shift
(
$results
);
$this
->
assertSame
(
SystemManager
::
REQUIREMENT_WARNING
,
$this
->
getOverallSeverity
(
$results
));
// If there are just plain no results, we should get REQUIREMENT_OK.
array_shift
(
$results
);
$this
->
assertSame
(
SystemManager
::
REQUIREMENT_OK
,
$this
->
getOverallSeverity
(
$results
));
}
}
Loading