diff --git a/core/lib/Drupal/Component/Uuid/Com.php b/core/lib/Drupal/Component/UUID/Com.php similarity index 73% rename from core/lib/Drupal/Component/Uuid/Com.php rename to core/lib/Drupal/Component/UUID/Com.php index 41cfba4..cbb0127 100644 --- a/core/lib/Drupal/Component/Uuid/Com.php +++ b/core/lib/Drupal/Component/UUID/Com.php @@ -2,17 +2,17 @@ /** * @file - * Definition of Drupal\Component\Uuid\Com. + * Definition of Drupal\Component\UUID\Com. */ -namespace Drupal\Component\Uuid; +namespace Drupal\Component\UUID; /** * UUID implementation using the Windows internal GUID extension. * * @see http://php.net/com_create_guid */ -class Com implements UuidInterface { +class Com implements UUIDInterface { public function generate() { // Remove {} wrapper and make lower case to keep result consistent. return drupal_strtolower(trim(com_create_guid(), '{}')); diff --git a/core/lib/Drupal/Component/UUID/PECL.php b/core/lib/Drupal/Component/UUID/PECL.php new file mode 100644 index 0000000..c86694b --- /dev/null +++ b/core/lib/Drupal/Component/UUID/PECL.php @@ -0,0 +1,21 @@ +plugin->generate(); @@ -70,17 +70,17 @@ class Uuid { return $plugin; } - $plugin = 'Drupal\Component\Uuid\PHP'; + $plugin = 'Drupal\Component\UUID\PHP'; // Debian/Ubuntu uses the (broken) OSSP extension as their UUID // implementation. The OSSP implementation is not compatible with the // PECL functions. if (function_exists('uuid_create') && !function_exists('uuid_make')) { - $plugin = 'Drupal\Component\Uuid\PECL'; + $plugin = 'Drupal\Component\UUID\PECL'; } // Try to use the COM implementation for Windows users. elseif (function_exists('com_create_guid')) { - $plugin = 'Drupal\Component\Uuid\Com'; + $plugin = 'Drupal\Component\UUID\Com'; } return $plugin; } diff --git a/core/lib/Drupal/Component/Uuid/UuidInterface.php b/core/lib/Drupal/Component/UUID/UUIDInterface.php similarity index 70% rename from core/lib/Drupal/Component/Uuid/UuidInterface.php rename to core/lib/Drupal/Component/UUID/UUIDInterface.php index d1225ba..3243ae2 100644 --- a/core/lib/Drupal/Component/Uuid/UuidInterface.php +++ b/core/lib/Drupal/Component/UUID/UUIDInterface.php @@ -2,15 +2,15 @@ /** * @file - * Definition of Drupal\Component\Uuid\UuidInterface. + * Definition of Drupal\Component\UUID\UUIDInterface. */ -namespace Drupal\Component\Uuid; +namespace Drupal\Component\UUID; /** * Interface that defines a UUID backend. */ -interface UuidInterface { +interface UUIDInterface { /** * Generates a Universally Unique IDentifier (UUID). diff --git a/core/lib/Drupal/Component/Uuid/PECL.php b/core/lib/Drupal/Component/Uuid/PECL.php deleted file mode 100644 index a82dc06..0000000 --- a/core/lib/Drupal/Component/Uuid/PECL.php +++ /dev/null @@ -1,21 +0,0 @@ -uuid = new Uuid(); + $this->uuid = new UUID(); parent::setUp(); } /** * Test generating a UUID. */ - public function testGenerateUuid() { + public function testGenerateUUID() { $uuid = $this->uuid->generate(); $this->assertTrue($this->uuid->isValid($uuid), 'UUID generation works.'); } @@ -47,7 +47,7 @@ class UuidUnitTest extends UnitTestBase { /** * Test that generated UUIDs are unique. */ - public function testUuidIsUnique() { + public function testUUIDIsUnique() { $uuid1 = $this->uuid->generate(); $uuid2 = $this->uuid->generate(); $this->assertNotEqual($uuid1, $uuid2, 'Same UUID was not generated twice.'); @@ -56,7 +56,7 @@ class UuidUnitTest extends UnitTestBase { /** * Test UUID validation. */ - function testUuidValidation() { + function testUUIDValidation() { // These valid UUIDs. $uuid_fqdn = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; $uuid_min = '00000000-0000-0000-0000-000000000000';