Skip to content
Snippets Groups Projects

Issue #3243405: Add a kernel test of UpdateVersionValidator

Merged Issue #3243405: Add a kernel test of UpdateVersionValidator
4 unresolved threads
4 unresolved threads

Merge request reports

Merged by Ted BowmanTed Bowman 3 years ago (Oct 18, 2021 2:51pm UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
19 'automatic_updates',
20 'package_manager',
21 ];
22
23 /**
24 * Tests that no error is raised if there are no major or minor updates.
25 */
26 public function testNoMajorOrMinorUpdates(): void {
27 $this->assertCheckerResultsFromManager([], TRUE);
28 }
29
30 /**
31 * Tests that an error is raised if there are major updates.
32 */
33 public function testMajorUpdates(): void {
34 $this->setCoreVersion('8.0.0');
  • Lets make sure that major version we test is great than 9 because that is what we set in \Drupal\Tests\automatic_updates\Kernel\AutomaticUpdatesKernelTestBase::setUp()

    We should make another issue to add another check UpdateVersionValidator to give a different if the version lower than the current version. We should have the same message for any version that is lower than the current.

  • Actually I was wrong :flushed:

    We do want to test with core being at version less 9 like you have here. but lets change the number to something like 8.9.1 to make it clear the problem is not coming the first version of 8.

  • Done

  • changed this line in version 3 of the diff

  • Please register or sign in to reply
  • 29
    30 /**
    31 * Tests that an error is raised if there are major updates.
    32 */
    33 public function testMajorUpdates(): void {
    34 $this->setCoreVersion('8.0.0');
    35 $result = ValidationResult::createError(['Updating from one major version to another is not supported.']);
    36 $this->assertCheckerResultsFromManager([$result], TRUE);
    37
    38 }
    39
    40 /**
    41 * Tests that an error is raised if there are minor updates.
    42 */
    43 public function testMinorUpdates(): void {
    44 $this->setCoreVersion('9.3.0');
  • Kunal Sachdev added 1 commit

    added 1 commit

    • 16e377a6 - changed the core version setting for test

    Compare with previous version

  • 16 * {@inheritdoc}
    17 */
    18 protected static $modules = [
    19 'automatic_updates',
    20 'package_manager',
    21 ];
    22
    23 /**
    24 * Tests that no error is raised if there are no major or minor updates.
    25 */
    26 public function testNoMajorOrMinorUpdates(): void {
    27 $this->assertCheckerResultsFromManager([], TRUE);
    28 }
    29
    30 /**
    31 * Tests that an error is raised if there are major updates.
  • 9 * @covers \Drupal\automatic_updates\Validator\UpdateVersionValidator
    10 *
    11 * @group automatic_updates
    12 */
    13 class UpdateVersionValidatorTest extends AutomaticUpdatesKernelTestBase {
    14
    15 /**
    16 * {@inheritdoc}
    17 */
    18 protected static $modules = [
    19 'automatic_updates',
    20 'package_manager',
    21 ];
    22
    23 /**
    24 * Tests that no error is raised if there are no major or minor updates.
  • Kunal Sachdev added 1 commit

    added 1 commit

    • ee91b5f1 - Changed the comments for the test functions

    Compare with previous version

  • merged

  • Please register or sign in to reply
    Loading