Have UuidInterface extend from JsonSerializable and cover it with a test

This commit is contained in:
Ben Ramsey
2015-07-16 11:36:05 -05:00
parent db27dc1680
commit 9092d16213
3 changed files with 12 additions and 2 deletions
+1 -1
View File
@@ -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.
+1 -1
View File
@@ -16,7 +16,7 @@ namespace Ramsey\Uuid;
use Ramsey\Uuid\Converter\NumberConverterInterface;
interface UuidInterface
interface UuidInterface extends \JsonSerializable
{
/**
+10
View File
@@ -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));
}
}