Skip to content
Snippets Groups Projects
Commit a480092f authored by Kunal Sachdev's avatar Kunal Sachdev Committed by Ted Bowman
Browse files

Issue #3243405 by kunal.sachdev: Add a kernel test of UpdateVersionValidator

parent 03831e0e
No related branches found
No related tags found
1 merge request!80Issue #3243405: Add a kernel test of UpdateVersionValidator
<?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);
}
}
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