getUsernameParts($generator->generate()); $this->assertEquals(3, count($parts)); $this->assertContains($parts[0], UsernameGenerator::ADJECTIVES); $this->assertContains($parts[1], UsernameGenerator::ADJECTIVES); $this->assertContains($parts[2], UsernameGenerator::NOUNS); } private function getUsernameParts(string $username): array { return explode('-', strtolower(preg_replace('/([a-z])([A-Z])/', '$1-$2', $username))); } }