File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -32,4 +32,19 @@ public function testSprintf()
3232 restore_error_handler ();
3333 }
3434 }
35+
36+ public function testPregMatch ()
37+ {
38+ require_once __DIR__ .'/../../generated/pcre.php ' ;
39+ require_once __DIR__ .'/../../lib/Exceptions/SafeExceptionInterface.php ' ;
40+ require_once __DIR__ .'/../../lib/Exceptions/AbstractSafeException.php ' ;
41+ require_once __DIR__ .'/../../generated/Exceptions/PcreException.php ' ;
42+
43+
44+ $ url = 'https://open.spotify.com/track/0nCqpKBrvDchO1BIvt7DTR?si=iLUKDfkLSy-IpnLA7qImnw ' ;
45+ $ spotifyRegex = "/https?:\/\/(?:embed\.|open\.)(?:spotify\.com\/)(?:track\/|\?uri=spotify:track:)((\w|-){22})/ " ;
46+ preg_match ($ spotifyRegex , $ url , $ matches );
47+ \preg_match ($ spotifyRegex , $ url , $ originalMatches );
48+ $ this ->assertSame ($ originalMatches , $ matches );
49+ }
3550}
You can’t perform that action at this time.
0 commit comments