assertSame($expected, SourceProfileId::fromRef($ref)); } public static function refs(): array { $uuid = 'ad600622-b98a-48ac-a448-89ef68fd2c46'; return [ 'irimc profile url' => ["https://membersearch.irimc.org/member/profile?id=$uuid", $uuid], 'extra query params' => ["https://membersearch.irimc.org/member/profile?lang=fa&id=$uuid&x=1", $uuid], 'different host, same id' => ["http://example.test/x?id=$uuid", $uuid], 'uppercase normalized to lowercase' => ['?id=' . strtoupper($uuid), $uuid], 'no id param' => ['https://membersearch.irimc.org/member/profile', null], 'plain code, not a url' => ['42507', null], 'empty' => ['', null], 'whitespace' => [' ', null], 'null' => [null, null], ]; } }