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; }
/** * @covers \Samshal\Rando\Rando::character */ public function testCharacterStaticExpectSymbol() { $expected = \Samshal\Rando\Rando::character(['symbols' => true]); $this->assertRegExp('/(!)?(@)?(#)?(\\$)?(%)?(\\^)?(&)?(\\()?(\\))?/', $expected); }