Exemplo n.º 1
0
 public function testFieldCrud()
 {
     $uuid = new Uuid('b8fc7a3e-0331-11e4-9583-080027f3add4');
     $this->assertTrue($uuid->isValid());
     $this->assertEquals('9583', $uuid->getField('clock_seq'));
     $uuid->setField('clock_seq', 'ffff');
     $this->assertEquals($uuid->toFormat(new PlainString()), 'b8fc7a3e-0331-11e4-ffff-080027f3add4');
 }
Exemplo n.º 2
0
 /**
  * @param string $byte A single byte
  * @return string
  */
 protected function setVariantByte($byte)
 {
     $bin = hex2bin($this->uuid->getField('clock_seq'));
     $bin[0] = $byte;
     $this->uuid->setField('clock_seq', bin2hex($bin));
 }