Skip to content

Commit 1d26e42

Browse files
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Max Barrett <34328348+MaximillianGroup@users.noreply.github.com>
1 parent 9076a35 commit 1d26e42

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

tests/unit/StarUserEnvGettersTest.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff 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
/**

0 commit comments

Comments
 (0)