You are here

public function ProjectReleaseTest::providerCreateFromArray in Drupal 10

Same name and namespace in other branches
  1. 9 core/modules/update/tests/src/Unit/ProjectReleaseTest.php \Drupal\Tests\update\Unit\ProjectReleaseTest::providerCreateFromArray()

Data provider for testCreateFromArray().

Return value

mixed Test cases for testCreateFromArray().

File

core/modules/update/tests/src/Unit/ProjectReleaseTest.php, line 64

Class

ProjectReleaseTest
@coversDefaultClass \Drupal\update\ProjectRelease

Namespace

Drupal\Tests\update\Unit

Code

public function providerCreateFromArray() : array {
  return [
    'default valid' => [
      'data' => [],
    ],
    'valid with extra field' => [
      'data' => [
        'extra' => 'This value is ignored and will not trigger a validation error.',
      ],
    ],
    'no release types' => [
      'data' => [
        'terms' => [
          'Release type' => [],
        ],
      ],
      'expected' => [
        'is_unsupported' => FALSE,
        'is_security_release' => FALSE,
        'is_insecure' => FALSE,
      ],
    ],
    'unpublished' => [
      'data' => [
        'status' => 'unpublished',
      ],
      'expected' => [
        'is_published' => FALSE,
      ],
    ],
    'core_compatible false' => [
      'data' => [
        'core_compatible' => FALSE,
      ],
    ],
    'core_compatible NULL' => [
      'data' => [
        'core_compatible' => NULL,
      ],
    ],
  ];
}