Newer
Older

Kunal Sachdev
committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?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);
}
}