Issue #3254615: Logic for determining which security releases should be considered if site has a dev release is installed is untested
8 open threads
Merge request reports
Activity
- Resolved by Kunal Sachdev
- Resolved by Kunal Sachdev
- Resolved by Kunal Sachdev
- Resolved by Kunal Sachdev
- Resolved by Kunal Sachdev
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); changed this line in version 2 of the diff
- Resolved by Kunal Sachdev
- Resolved by Kunal Sachdev
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 changed this line in version 4 of the diff
- Resolved by Kunal Sachdev
- Resolved by Kunal Sachdev
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() { changed this line in version 4 of the diff
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() { changed this line in version 4 of the diff
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. - Edited by Ted Bowman
changed this line in version 5 of the diff
@see update_test_system_info_alter()
added.Edited by Kunal Sachdev
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 { changed this line in version 5 of the diff
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 { changed this line in version 5 of the diff
added 205 commits
-
80224d4c...2103b199 - 198 commits from branch
project:9.4.x
- 8730f9fa - created new test
- f5538686 - added test coverage for no security updates
- ae392f39 - phpcbf
- b58a3c24 - added comments to improve test and fixtures
- 47b3647e - indent and remove comment
- df32eb49 - improved test and fixture
- 40f1a393 - improved test
Toggle commit list-
80224d4c...2103b199 - 198 commits from branch
added 3973 commits
- d32a149c...8d1ff206 - 3963 earlier commits
- 16964d02 - Issue #2575105 by Berdir, catch, longwave, quietone, kristiaanvandeneynde,...
- 26e67591 - created new test
- e2c42dc6 - added test coverage for no security updates
- bed56d3a - phpcbf
- 16994baf - added comments to improve test and fixtures
- a24178d5 - indent and remove comment
- b63ca0e9 - improved test and fixture
- 2de6e7b7 - improved test
- 2cf78cbb - @see added in comment
- 8c330ea8 - declate $client
Toggle commit list
Please register or sign in to reply