Refactor from/toString methods to codecs

This commit is contained in:
Thibaud Fabre
2014-10-30 09:53:43 +01:00
parent 65916f2928
commit 13b3bf7ed9
8 changed files with 276 additions and 70 deletions
+18
View File
@@ -0,0 +1,18 @@
<?php
namespace Rhumsaa\Uuid\Codec;
use Rhumsaa\Uuid\TestCase;
class StringCodecTest extends TestCase
{
public function testDecodeParsesUuidStringCorrectly()
{
$codec = new StringCodec();
$uuid = $codec->decode('ff6f8cb0-c57d-11e1-9b21-0800200c9a66');
$this->assertInstanceOf('\Rhumsaa\Uuid\Uuid', $uuid);
$this->assertEquals('ff6f8cb0-c57d-11e1-9b21-0800200c9a66', $uuid->toString());
}
}