function SecurityAdvisoriesFetcherTest::getAdvisories

Same name and namespace in other branches
  1. 9 core/modules/system/tests/src/Kernel/SecurityAdvisories/SecurityAdvisoriesFetcherTest.php \Drupal\Tests\system\Kernel\SecurityAdvisories\SecurityAdvisoriesFetcherTest::getAdvisories()
  2. 10 core/modules/system/tests/src/Kernel/SecurityAdvisories/SecurityAdvisoriesFetcherTest.php \Drupal\Tests\system\Kernel\SecurityAdvisories\SecurityAdvisoriesFetcherTest::getAdvisories()

Gets the advisories from the 'system.sa_fetcher' service.

Parameters

bool $allow_http_request: Argument to pass on to SecurityAdvisoriesFetcher::getSecurityAdvisories().

Return value

\Drupal\system\SecurityAdvisories\SecurityAdvisory[]|null The return value of SecurityAdvisoriesFetcher::getSecurityAdvisories().

6 calls to SecurityAdvisoriesFetcherTest::getAdvisories()
SecurityAdvisoriesFetcherTest::testHttpFallback in core/modules/system/tests/src/Kernel/SecurityAdvisories/SecurityAdvisoriesFetcherTest.php
@covers ::doRequest @covers ::getSecurityAdvisories
SecurityAdvisoriesFetcherTest::testIgnoreAdvisories in core/modules/system/tests/src/Kernel/SecurityAdvisories/SecurityAdvisoriesFetcherTest.php
Tests advisories that should be ignored.
SecurityAdvisoriesFetcherTest::testIntervalConfigUpdate in core/modules/system/tests/src/Kernel/SecurityAdvisories/SecurityAdvisoriesFetcherTest.php
Tests that the stored advisories response is deleted on interval decrease.
SecurityAdvisoriesFetcherTest::testInvalidJsonResponse in core/modules/system/tests/src/Kernel/SecurityAdvisories/SecurityAdvisoriesFetcherTest.php
Tests that invalid JSON feed responses are not stored.
SecurityAdvisoriesFetcherTest::testNoHttpFallback in core/modules/system/tests/src/Kernel/SecurityAdvisories/SecurityAdvisoriesFetcherTest.php
@covers ::doRequest @covers ::getSecurityAdvisories

... See full list

File

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

Class

SecurityAdvisoriesFetcherTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21system%21src%21SecurityAdvisories%21SecurityAdvisoriesFetcher.php/class/SecurityAdvisoriesFetcher/11.x" title="Defines a service to get security advisories." class="local">\Drupal\system\SecurityAdvisories\SecurityAdvisoriesFetcher</a>

Namespace

Drupal\Tests\system\Kernel\SecurityAdvisories

Code

protected function getAdvisories(bool $allow_http_request = TRUE) : ?array {
    $fetcher = $this->container
        ->get('system.sa_fetcher');
    return $fetcher->getSecurityAdvisories($allow_http_request);
}

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