You are here

public function UuidTest::providerUuidInstances in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Component/Uuid/UuidTest.php \Drupal\Tests\Component\Uuid\UuidTest::providerUuidInstances()
  2. 9 core/tests/Drupal/Tests/Component/Uuid/UuidTest.php \Drupal\Tests\Component\Uuid\UuidTest::providerUuidInstances()

Data provider for UUID instance tests.

Return value

array

File

core/tests/Drupal/Tests/Component/Uuid/UuidTest.php, line 42

Class

UuidTest
Tests the handling of Universally Unique Identifiers (UUIDs).

Namespace

Drupal\Tests\Component\Uuid

Code

public function providerUuidInstances() {
  $instances = [];
  $instances[][] = new Php();

  // If valid PECL extensions exists add to list.
  if (function_exists('uuid_create') && !function_exists('uuid_make')) {
    $instances[][] = new Pecl();
  }

  // If we are on Windows add the com implementation as well.
  if (function_exists('com_create_guid')) {
    $instances[][] = new Com();
  }
  return $instances;
}