isPsa example

$data = $changes;
    $data += $this->getValidData();
    $expected += $data;

    $sa = SecurityAdvisory::createFromArray($data);
    $this->assertInstanceOf(SecurityAdvisory::class$sa);
    $this->assertSame($expected['title']$sa->getTitle());
    $this->assertSame($expected['project']$sa->getProject());
    $this->assertSame($expected['type']$sa->getProjectType());
    $this->assertSame($expected['link']$sa->getUrl());
    $this->assertSame($expected['insecure']$sa->getInsecureVersions());
    $this->assertSame($expected['is_psa']$sa->isPsa());
    $this->assertSame($expected['type'] === 'core', $sa->isCoreAdvisory());
  }

  /** * Data provider for testCreateFromArray(). */
  public function providerCreateFromArray(): array {
    return [
      // For 'is_psa' the return value should converted to any array.       [
        ['is_psa' => 1],
        [

  protected function isApplicable(SecurityAdvisory $sa): bool {
    // Only projects that are in the site's codebase can be applicable. Core     // will always be in the codebase, and other projects are in the codebase if     // ::getProjectInfo() finds a matching extension for the project name.     if ($sa->isCoreAdvisory() || $this->getMatchingExtensionInfo($sa)) {
      // Public service announcements are always applicable because they are not       // dependent on the version of the project that is currently present on       // the site. Other advisories are only applicable if they match the       // existing version.       return $sa->isPsa() || $this->matchesExistingVersion($sa);
    }
    return FALSE;
  }

  /** * Makes an HTTPS GET request, with a possible HTTP fallback. * * This method will fall back to HTTP if the HTTPS request fails and the site * setting 'update_fetch_with_http_fallback' is set to TRUE. * * @param int $timeout * The timeout in seconds for the request. * * @return string * The response. */
Home | Imprint | This part of the site doesn't use cookies.