function SecurityAdvisoryTest::providerCreateFromArray

Same name and namespace in other branches
  1. 9 core/modules/system/tests/src/Unit/SecurityAdvisories/SecurityAdvisoryTest.php \Drupal\Tests\system\Unit\SecurityAdvisories\SecurityAdvisoryTest::providerCreateFromArray()
  2. 11.x 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 50

Class

SecurityAdvisoryTest
@coversDefaultClass \Drupal\system\SecurityAdvisories\SecurityAdvisory[[api-linebreak]]

Namespace

Drupal\Tests\system\Unit\SecurityAdvisories

Code

public static 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',
      ],
    ],
  ];
}

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