public function it_should_generate_ordered_uuid(UuidFactoryInterface $factory) { $factory->uuid1()->willReturn('a8098c1a-f86e-11da-bd1a-00112444be1e'); $this->generateOrderedUuid1()->shouldReturn('11daf86ea8098c1abd1a00112444be1e'); }
/** * @return string */ public function generateOrderedUuid1() { $uuid = str_replace('-', '', (string) $this->factory->uuid1()); $uuid = substr($uuid, 12, 4) . substr($uuid, 8, 4) . substr($uuid, 0, 8) . substr($uuid, 16); return $uuid; }