diff --git a/core/tests/Drupal/Tests/Component/Uuid/UuidTest.php b/core/tests/Drupal/Tests/Component/Uuid/UuidTest.php index 99637cc..1d587f7 100644 --- a/core/tests/Drupal/Tests/Component/Uuid/UuidTest.php +++ b/core/tests/Drupal/Tests/Component/Uuid/UuidTest.php @@ -9,9 +9,12 @@ use Drupal\Tests\UnitTestCase; use Drupal\Core\CoreBundle; +use Symfony\Component\DependencyInjection\ContainerBuilder; /** * Tests the Drupal\Component\Uuid\Uuid class. + * + * @group UUID */ class UuidTest extends UnitTestCase { @@ -36,20 +39,18 @@ public static function getInfo() { protected function setUp() { // Initiate the generator. We use the CoreBundle to save repeating the // logic. - $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder') - ->getMock(); + $container = new ContainerBuilder(); $class = CoreBundle::registerUuid($container); $this->uuidInstances[] = new $class(); - - // Add additional uuid implementations when accessible. - if (function_exists('uuid_create') && !function_exists('uuid_make')) { - $this->uuidInstances[] = new \Drupal\Component\Uuid\Pecl(); - } - elseif (function_exists('com_create_guid')) { - $this->uuidInstances[] = new \Drupal\Component\Uuid\Com(); + // Add additional uuid implementations when available. + if ($class != 'Drupal\Component\Uuid\Php') { + $this->uuidInstances[] = new \Drupal\Component\Uuid\Php(); + // If we are on windows add the com implementation as well. + if ($class != 'Drupal\Component\Uuid\Com' && function_exists('com_create_guid')) { + $this->uuidInstances[] = new \Drupal\Component\Uuid\Com(); + } } - } /** @@ -97,4 +98,5 @@ public function testUuidValidation() { $this->assertFalse((bool) $instance->isValid($invalid_length)); } } + }