assertEquals($length, strlen($this->generateRandomString($length))); } public function provideLengths(): array { return [ [1], [10], [15], ]; } /** * @test */ public function generatesUuidV4() { $uuidPattern = '/[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}/'; $this->assertRegExp($uuidPattern, $this->generateV4Uuid()); $this->assertRegExp($uuidPattern, $this->generateV4Uuid()); $this->assertRegExp($uuidPattern, $this->generateV4Uuid()); $this->assertRegExp($uuidPattern, $this->generateV4Uuid()); $this->assertRegExp($uuidPattern, $this->generateV4Uuid()); } }