function SecurityAdvisoriesFetcherTest::testIgnoreAdvisories

Same name in other branches
  1. 9 core/modules/system/tests/src/Kernel/SecurityAdvisories/SecurityAdvisoriesFetcherTest.php \Drupal\Tests\system\Kernel\SecurityAdvisories\SecurityAdvisoriesFetcherTest::testIgnoreAdvisories()
  2. 11.x core/modules/system/tests/src/Kernel/SecurityAdvisories/SecurityAdvisoriesFetcherTest.php \Drupal\Tests\system\Kernel\SecurityAdvisories\SecurityAdvisoriesFetcherTest::testIgnoreAdvisories()

Tests advisories that should be ignored.

@dataProvider providerIgnoreAdvisories

Parameters

mixed[] $feed_item: The feed item to test. 'title' and 'link' are omitted from this array because they do not need to vary between test cases.

string|null $existing_version: The existing version of the module.

File

core/modules/system/tests/src/Kernel/SecurityAdvisories/SecurityAdvisoriesFetcherTest.php, line 250

Class

SecurityAdvisoriesFetcherTest
@coversDefaultClass \Drupal\system\SecurityAdvisories\SecurityAdvisoriesFetcher

Namespace

Drupal\Tests\system\Kernel\SecurityAdvisories

Code

public function testIgnoreAdvisories(array $feed_item, ?string $existing_version = NULL) : void {
    $this->setFeedItems([
        $feed_item,
    ]);
    if ($existing_version !== NULL) {
        $this->setExistingProjectVersion($existing_version);
    }
    $this->assertCount(0, $this->getAdvisories());
    $this->assertCount(1, $this->history);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.