Пример #1
0
 private function doRandomization()
 {
     $length = !empty($this->length) ? $this->length : Rando::integer(['min' => $this->minLength, 'max' => $this->maxLength]);
     $string = '';
     while ($length > 0) {
         if (empty($this->pool)) {
             $string .= Rando::character();
         } else {
             $string .= Rando::character(['pool' => $this->pool]);
         }
         $length--;
     }
     return $string;
 }
Пример #2
0
 /**
  * @covers \Samshal\Rando\Rando::character 
  */
 public function testCharacterStaticExpectSymbol()
 {
     $expected = \Samshal\Rando\Rando::character(['symbols' => true]);
     $this->assertRegExp('/(!)?(@)?(#)?(\\$)?(%)?(\\^)?(&)?(\\()?(\\))?/', $expected);
 }