コード例 #1
0
 /**
  *
  */
 public function testV5()
 {
     $this->assertEquals(5, substr(UUID::v5(UUID::DNS, 'hello'), 14, 1));
     $this->assertTrue(in_array(substr(UUID::v5(UUID::DNS, 'hello'), 19, 1), [8, 9, 'a', 'b']));
     $this->assertEquals(UUID::v5(UUID::DNS, 'hello'), UUID::v5(UUID::DNS, 'hello'));
     $this->assertNotEquals(UUID::v5(UUID::DNS, 'hello'), UUID::v5(UUID::URL, 'hello'));
     $this->assertNotEquals(UUID::v5(UUID::DNS, 'hello'), UUID::v5(UUID::DNS, 'goodbye'));
     $this->assertTrue(UUID::validate(UUID::v5(UUID::DNS, 'hello')));
 }
コード例 #2
0
ファイル: Validator.php プロジェクト: KasperGreen/framework
 /**
  * Checks that the field value is a valid UUID.
  *
  * @access  protected
  * @param   string     $input  Field value
  * @return  boolean
  */
 protected function validateUuid($input)
 {
     return UUID::validate($input);
 }
コード例 #3
0
ファイル: ORMTest.php プロジェクト: rafaelharus/framework
 /**
  *
  */
 public function testUUIDKey()
 {
     $uuid = UUIDKey::create(['value' => 'foo']);
     $this->assertTrue(UUID::validate($uuid->id));
     $uuid = UUIDKey::first();
     $this->assertTrue(UUID::validate($uuid->id));
 }