@@ -66,13 +66,19 @@ public function testWindowsBinaryCompatibility(Version $version): void
66
66
$ binary = __DIR__ . '/storage/bass- ' . $ version ->toString () . '.dll ' ;
67
67
68
68
if (!\is_file ($ binary )) {
69
- Downloader::download ('https://www.un4seen.com/files/bass%s.zip ' , [
69
+ $ result = Downloader::download ('https://www.un4seen.com/files/bass%s.zip ' , [
70
70
\str_replace ('. ' , '' , $ version ->toString ()),
71
- ])
72
- ->whenExists ('x64/bass.dll ' ,
73
- static fn (DownloaderResult $ ctx ) => $ ctx ->extract ('x64/bass.dll ' , $ binary ),
74
- static fn (DownloaderResult $ ctx ) => $ ctx ->extract ('bass.dll ' , $ binary ),
75
- );
71
+ ]);
72
+
73
+ // x64 and >= 2.4
74
+ if (\PHP_INT_SIZE === 8 && $ result ->exists ('x64/bass.dll ' )) {
75
+ $ result ->extract ('x64/bass.dll ' , $ binary );
76
+ // x86 and < 2.4
77
+ } elseif (\PHP_INT_SIZE === 4 && $ result ->exists ('bass.dll ' )) {
78
+ $ result ->extract ('bass.dll ' , $ binary );
79
+ } else {
80
+ $ this ->markTestSkipped ('Incompatible OS bits ' );
81
+ }
76
82
}
77
83
78
84
$ this ->expectNotToPerformAssertions ();
@@ -94,10 +100,19 @@ public function testDarwinBinaryCompatibility(Version $version): void
94
100
$ binary = __DIR__ . '/storage/libbass- ' . $ version ->toString () . '.dylib ' ;
95
101
96
102
if (!\is_file ($ binary )) {
97
- Downloader::download ('https://www.un4seen.com/files/bass%s-osx.zip ' , [
103
+ $ result = Downloader::download ('https://www.un4seen.com/files/bass%s-osx.zip ' , [
98
104
\str_replace ('. ' , '' , $ version ->toString ()),
99
- ])
100
- ->extract ('libbass.dylib ' , $ binary );
105
+ ]);
106
+
107
+ // x64 and >= 2.4
108
+ if (\PHP_INT_SIZE === 8 && \version_compare ($ version ->toString (), '2.4 ' , '>= ' )) {
109
+ $ result ->extract ('libbass.dylib ' , $ binary );
110
+ // x86 and < 2.4
111
+ } elseif (\PHP_INT_SIZE === 4 && \version_compare ($ version ->toString (), '2.4 ' , '< ' )) {
112
+ $ result ->extract ('libbass.dylib ' , $ binary );
113
+ } else {
114
+ $ this ->markTestSkipped ('Incompatible OS bits ' );
115
+ }
101
116
}
102
117
103
118
$ this ->expectNotToPerformAssertions ();
0 commit comments