Exemplo n.º 1
0
Arquivo: Event.php Projeto: rask/wplog
 /**
  * Event constructor. Get an UUID for the event.
  *
  * @since 0.1.0
  * @return void
  */
 public function __construct()
 {
     $this->uuid = Uuid::getUuid();
     $now = new \DateTime('now');
     $now->setTimezone(new \DateTimeZone('UTC'));
     $timestamp = $now->format('Y-m-d H:i:s');
     $this->timestamp = $timestamp;
 }
Exemplo n.º 2
0
 function testItUnpacksUuidsFromBinaryForm()
 {
     $uuid = Uuid::getUuid();
     $packed = Uuid::pack($uuid);
     $unpacked = Uuid::unpack($packed);
     $this->assertRegExp('%^[0-9A-Za-z-]+$%', $unpacked);
     $this->assertEquals($unpacked, $uuid);
 }