Skip to content
Snippets Groups Projects

Issue #3254615: Logic for determining which security releases should be considered if site has a dev release is installed is untested

Issue #3254615: Logic for determining which security releases should be considered if site has a dev release is installed is untested

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Ted Bowman
  • Ted Bowman
  • Ted Bowman
  • Ted Bowman
  • 89
    90 /**
    91 * Tests security updates are empty with a dev version and an empty timestamp.
    92 */
    93 public function testSecurityUpdateEmptyProjectTimestamp() {
    94 $system_info = [
    95 '#all' => [
    96 // We need to think we're running a -dev snapshot to see dates.
    97 'version' => '8.1.0-dev',
    98 'datestamp' => '0',
    99 ],
    100 ];
    101 $this->config('update_test.settings')->set('system_info', $system_info)->save();
    102 update_storage_clear();
    103 $available = update_get_available(TRUE);
    104 $new = update_calculate_project_data($available);
  • Ted Bowman
  • Kunal Sachdev added 1 commit

    added 1 commit

    • ef6d1724 - added comments to improve test and fixtures

    Compare with previous version

  • Ted Bowman added 1 commit

    added 1 commit

    Compare with previous version

  • Ted Bowman
  • 100 */
    101 public function testSecurityUpdateEmptyProjectTimestamp() {
    102 $system_info = [
    103 '#all' => [
    104 'version' => '8.1.0-dev',
    105 'datestamp' => '0',
    106 ],
    107 ];
    108 $new = $this->getProjectData($system_info);
    109 $this->assertArrayNotHasKey('security updates', $new['drupal']);
    110 $this->assertSame(UpdateFetcherInterface::NOT_CHECKED, $new['drupal']['status']);
    111 $this->assertSame('Unknown release date', (string) $new['drupal']['reason']);
    112 }
    113
    114 /**
    115 * Function to setting update configurations and getting project data from
  • Ted Bowman
  • Ted Bowman
  • 66 $this->container->set('http_client', $this->client);
    67 }
    68
    69 /**
    70 * Tests security updates when the installed version is a dev version.
    71 *
    72 * The xml fixture used here has two security releases 8.1.2 and 8.1.1.
    73 *
    74 * Here the timestamp for the installed dev version is set to 1280424641 and
    75 * according to the current logic for dev installed version ,8.1.2 will be
    76 * shown as security update as the date of this security release i.e.
    77 * 1280424741 is greater than the timestamp of the installed version + 100
    78 * seconds. 8.1.1 will not be shown as security update because it's date i.e.
    79 * 1280424740 is less than timestamp of the installed version + 100 seconds.
    80 */
    81 public function testSecurityUpdates() {
  • 86 ],
    87 ];
    88 $new = $this->getProjectData($system_info);
    89 $this->assertCount(1, $new['drupal']['security updates']);
    90 $this->assertSame('8.1.2', $new['drupal']['security updates'][0]['version']);
    91 $this->assertSame(UpdateManagerInterface::NOT_CURRENT, $new['drupal']['status']);
    92 }
    93
    94 /**
    95 * Tests security updates are empty with a dev version and an empty timestamp.
    96 *
    97 * Here the timestamp for the installed dev version is set to 0(empty
    98 * timestamp) and according to the current logic for dev installed version,
    99 * no updates will be shown as security update.
    100 */
    101 public function testSecurityUpdateEmptyProjectTimestamp() {
  • Kunal Sachdev added 1 commit

    added 1 commit

    Compare with previous version

  • 103 '#all' => [
    104 'version' => '8.1.0-dev',
    105 'datestamp' => '0',
    106 ],
    107 ];
    108 $new = $this->getProjectData($system_info);
    109 $this->assertArrayNotHasKey('security updates', $new['drupal']);
    110 $this->assertSame(UpdateFetcherInterface::NOT_CHECKED, $new['drupal']['status']);
    111 $this->assertSame('Unknown release date', (string) $new['drupal']['reason']);
    112 }
    113
    114 /**
    115 * Gets project data from update_calculate_project_data().
    116 *
    117 * @param array $system_info
    118 * System Information.
  • 86 ],
    87 ];
    88 $project_data = $this->getProjectData($system_info);
    89 $this->assertCount(1, $project_data['drupal']['security updates']);
    90 $this->assertSame('8.1.2', $project_data['drupal']['security updates'][0]['version']);
    91 $this->assertSame(UpdateManagerInterface::NOT_CURRENT, $project_data['drupal']['status']);
    92 }
    93
    94 /**
    95 * Tests security updates are empty with a dev version and an empty timestamp.
    96 *
    97 * Here the timestamp for the installed dev version is set to 0(empty
    98 * timestamp) and according to the current logic for dev installed version,
    99 * no updates will be shown as security update.
    100 */
    101 public function testSecurityUpdateEmptyProjectTimestamp():void {
  • 66 $this->container->set('http_client', $this->client);
    67 }
    68
    69 /**
    70 * Tests security updates when the installed version is a dev version.
    71 *
    72 * The xml fixture used here has two security releases 8.1.2 and 8.1.1.
    73 *
    74 * Here the timestamp for the installed dev version is set to 1280424641.
    75 * 8.1.2 will be shown as security update as the date of this security release
    76 * i.e. 1280424741 is greater than the timestamp of the installed version +
    77 * 100 seconds. 8.1.1 will not be shown as security update because it's date
    78 * i.e. 1280424740 is less than timestamp of the installed version + 100
    79 * seconds.
    80 */
    81 public function testSecurityUpdates():void {
  • Kunal Sachdev added 1 commit

    added 1 commit

    Compare with previous version

  • Kunal Sachdev added 205 commits

    added 205 commits

    Compare with previous version

  • Kunal Sachdev added 1 commit

    added 1 commit

    Compare with previous version

  • quietone added 3973 commits

    added 3973 commits

    Compare with previous version

  • quietone changed the description

    changed the description

  • quietone changed target branch from 9.4.x to 11.x

    changed target branch from 9.4.x to 11.x

  • 1 <?php
    2
    3 namespace Drupal\Tests\update\Kernel;
  • added 1 commit

    • 74158fdd - Apply 1 suggestion(s) to 1 file(s)

    Compare with previous version

  • closed

  • Please register or sign in to reply
    Loading