You are here

protected function SecurityAdvisoryTest::getValidData in Drupal 9

Gets valid data for a security advisory.

Return value

mixed[] The data for the security advisory.

3 calls to SecurityAdvisoryTest::getValidData()
SecurityAdvisoryTest::testCreateFromArray in core/modules/system/tests/src/Unit/SecurityAdvisories/SecurityAdvisoryTest.php
Tests creating with valid data.
SecurityAdvisoryTest::testCreateFromArrayInvalidField in core/modules/system/tests/src/Unit/SecurityAdvisories/SecurityAdvisoryTest.php
Tests exceptions for invalid field types.
SecurityAdvisoryTest::testCreateFromArrayMissingField in core/modules/system/tests/src/Unit/SecurityAdvisories/SecurityAdvisoryTest.php
Tests exceptions with missing fields.

File

core/modules/system/tests/src/Unit/SecurityAdvisories/SecurityAdvisoryTest.php, line 166

Class

SecurityAdvisoryTest
@coversDefaultClass \Drupal\system\SecurityAdvisories\SecurityAdvisory

Namespace

Drupal\Tests\system\Unit\SecurityAdvisories

Code

protected function getValidData() : array {
  return [
    'title' => 'Generic Module1 Test - Moderately critical - Access bypass - SA-CONTRIB-2019-02-02',
    'link' => 'https://www.drupal.org/SA-CONTRIB-2019-02-02',
    'project' => 'generic_module1_test',
    'type' => 'module',
    'is_psa' => FALSE,
    'insecure' => [
      '8.x-1.1',
    ],
    'pubDate' => 'Tue, 19 Mar 2019 12 => 50 => 00 +0000',
    // New fields added to the JSON feed should be ignored and not cause a
    // validation error.
    'unknown_field' => 'ignored value',
  ];
}