Esempio n. 1
0
 public function testValidAlphaNumericRandom()
 {
     // Default is size 10
     $s = new Stringizer("");
     $randomString1 = $s->randomAlphanumeric()->getString();
     // Default is size 10
     $this->assertEquals(10, $s->length());
     // Confirm is AlphaNumeric
     $this->assertEquals(true, $s->isAlphaNumeric());
     $randomString2 = $s->randomAlphanumeric()->getString();
     $this->assertNotEquals($randomString1, $randomString2);
     // Test non default size
     $randomString2 = $s->randomAlphanumeric(20)->getString();
     $this->assertEquals(20, $s->length());
 }
 public function testInValidMultiByte()
 {
     $s = new Stringizer("こんにちは");
     $this->assertEquals(false, $s->isAlphaNumeric());
 }