You are here

public function SecurityAdvisoryTest::providerCreateFromArray in Drupal 9

Same name and namespace in other branches
  1. 10 core/modules/system/tests/src/Unit/SecurityAdvisories/SecurityAdvisoryTest.php \Drupal\Tests\system\Unit\SecurityAdvisories\SecurityAdvisoryTest::providerCreateFromArray()

Data provider for testCreateFromArray().

File

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

Class

SecurityAdvisoryTest
@coversDefaultClass \Drupal\system\SecurityAdvisories\SecurityAdvisory

Namespace

Drupal\Tests\system\Unit\SecurityAdvisories

Code

public function providerCreateFromArray() : array {
  return [
    // For 'is_psa' the return value should converted to any array.
    [
      [
        'is_psa' => 1,
      ],
      [
        'is_psa' => TRUE,
      ],
    ],
    [
      [
        'is_psa' => '1',
      ],
      [
        'is_psa' => TRUE,
      ],
    ],
    [
      [
        'is_psa' => TRUE,
      ],
      [
        'is_psa' => TRUE,
      ],
    ],
    [
      [
        'is_psa' => 0,
      ],
      [
        'is_psa' => FALSE,
      ],
    ],
    [
      [
        'is_psa' => '0',
      ],
      [
        'is_psa' => FALSE,
      ],
    ],
    [
      [
        'is_psa' => FALSE,
      ],
      [
        'is_psa' => FALSE,
      ],
    ],
    // Test cases that ensure ::isCoreAdvisory only returns TRUE for core.
    [
      [
        'type' => 'module',
      ],
    ],
    [
      [
        'type' => 'theme',
      ],
    ],
    [
      [
        'type' => 'core',
      ],
    ],
  ];
}