mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-14 15:56:48 +03:00
Have UuidInterface extend from JsonSerializable and cover it with a test
This commit is contained in:
+1
-1
@@ -35,7 +35,7 @@ use Ramsey\Uuid\Codec\CodecInterface;
|
||||
* @link http://docs.oracle.com/javase/6/docs/api/java/util/UUID.html
|
||||
*/
|
||||
|
||||
class Uuid implements UuidInterface, \JsonSerializable
|
||||
class Uuid implements UuidInterface
|
||||
{
|
||||
/**
|
||||
* When this namespace is specified, the name string is a fully-qualified domain name.
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Ramsey\Uuid;
|
||||
|
||||
use Ramsey\Uuid\Converter\NumberConverterInterface;
|
||||
|
||||
interface UuidInterface
|
||||
interface UuidInterface extends \JsonSerializable
|
||||
{
|
||||
|
||||
/**
|
||||
|
||||
@@ -1742,4 +1742,14 @@ class UuidTest extends TestCase
|
||||
$uuid = Uuid::uuid1();
|
||||
$uuid->getInteger();
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Ramsey\Uuid\Uuid::jsonSerialize
|
||||
*/
|
||||
public function testJsonSerialize()
|
||||
{
|
||||
$uuid = Uuid::uuid1();
|
||||
|
||||
$this->assertEquals('"' . $uuid->toString() . '"', json_encode($uuid));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user