File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -512,27 +512,23 @@ public function test_get_user_os_detects_mac(): void
512512 }
513513
514514 /**
515- * An Android User-Agent string contains "Linux" which matches before "android"
516- * in the implementation's pattern map, so 'Linux' is the expected result.
515+ * An Android User-Agent string should be classified as 'Android'.
517516 */
518- public function test_get_user_os_returns_linux_for_android_ua (): void
517+ public function test_get_user_os_detects_android (): void
519518 {
520519 $ _SERVER ['HTTP_USER_AGENT ' ] = 'Mozilla/5.0 (Linux; Android 13; Pixel 7) AppleWebKit/537.36 ' ;
521520
522- // The map checks 'linux' before 'android', so Android UAs resolve to 'Linux'.
523- $ this ->assertSame ('Linux ' , StarUserEnv::getUserOS ());
521+ $ this ->assertSame ('Android ' , StarUserEnv::getUserOS ());
524522 }
525523
526524 /**
527- * An iPhone User-Agent string contains "like Mac OS X" which matches the
528- * 'macintosh|mac os x|macos' pattern before 'ipad|ipod|iphone', so 'Mac' is returned.
525+ * An iPhone User-Agent string should be classified as 'iOS'.
529526 */
530- public function test_get_user_os_returns_mac_for_ios_ua (): void
527+ public function test_get_user_os_detects_ios (): void
531528 {
532529 $ _SERVER ['HTTP_USER_AGENT ' ] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) ' ;
533530
534- // 'mac os x' matches before 'iphone' in the ordered pattern map.
535- $ this ->assertSame ('Mac ' , StarUserEnv::getUserOS ());
531+ $ this ->assertSame ('iOS ' , StarUserEnv::getUserOS ());
536532 }
537533
538534 /**
You can’t perform that action at this time.
0 commit comments