mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-15 16:07:55 +03:00
Introduce separate class support for GUIDs
This commit is contained in:
@@ -70,23 +70,14 @@ class StringCodecTest extends TestCase
|
||||
$this->assertEquals($this->uuidString, $result);
|
||||
}
|
||||
|
||||
public function testEncodeBinaryUsesHexadecimalValue(): void
|
||||
{
|
||||
$this->uuid->expects($this->once())
|
||||
->method('getHex')
|
||||
->willReturn('123456781234abcdabef1234abcd4321');
|
||||
$codec = new StringCodec($this->builder);
|
||||
$codec->encodeBinary($this->uuid);
|
||||
}
|
||||
|
||||
public function testEncodeBinaryReturnsBinaryString(): void
|
||||
{
|
||||
$expected = hex2bin('123456781234abcdabef1234abcd4321');
|
||||
$this->uuid->method('getHex')
|
||||
->willReturn('123456781234abcdabef1234abcd4321');
|
||||
$this->uuid->method('getBytes')
|
||||
->willReturn(hex2bin('123456781234abcdabef1234abcd4321'));
|
||||
$codec = new StringCodec($this->builder);
|
||||
$result = $codec->encodeBinary($this->uuid);
|
||||
$this->assertEquals($expected, $result);
|
||||
$this->assertSame($expected, $result);
|
||||
}
|
||||
|
||||
public function testDecodeUsesBuilderOnFields(): void
|
||||
|
||||
Reference in New Issue
Block a user