function SecurityAdvisoriesFetcherTest::setExistingProjectVersion
Sets the existing version of the project.
Parameters
string $existing_version: The existing version of the project.
2 calls to SecurityAdvisoriesFetcherTest::setExistingProjectVersion()
- SecurityAdvisoriesFetcherTest::testIgnoreAdvisories in core/
modules/ system/ tests/ src/ Kernel/ SecurityAdvisories/ SecurityAdvisoriesFetcherTest.php  - Tests advisories that should be ignored.
 - SecurityAdvisoriesFetcherTest::testShowAdvisories in core/
modules/ system/ tests/ src/ Kernel/ SecurityAdvisories/ SecurityAdvisoriesFetcherTest.php  - Tests contrib advisories that should be displayed.
 
File
- 
              core/
modules/ system/ tests/ src/ Kernel/ SecurityAdvisories/ SecurityAdvisoriesFetcherTest.php, line 520  
Class
- SecurityAdvisoriesFetcherTest
 - @coversDefaultClass \Drupal\system\SecurityAdvisories\SecurityAdvisoriesFetcher[[api-linebreak]]
 
Namespace
Drupal\Tests\system\Kernel\SecurityAdvisoriesCode
protected function setExistingProjectVersion(string $existing_version) : void {
  $module_list = $this->prophesize(ModuleExtensionList::class);
  $extension = $this->prophesize(Extension::class)
    ->reveal();
  $extension->info = [
    'project' => 'the_project',
  ];
  if (!empty($existing_version)) {
    $extension->info['version'] = $existing_version;
  }
  $module_list->getList()
    ->willReturn([
    $extension,
  ]);
  $this->container
    ->set('extension.list.module', $module_list->reveal());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.