@@ -105,6 +105,54 @@ describe('withPHPExtensions', () => {
105105 ) . rejects . toThrow ( 'External PHP extensions require JSPI' ) ;
106106 } ) ;
107107
108+ it ( 'stages extension artifacts without adding a php.ini scan dir' , async ( ) => {
109+ const tempDir = await mkdtemp (
110+ path . join ( tmpdir ( ) , 'php-wasm-extension-' )
111+ ) ;
112+ try {
113+ const extensionBytes = new Uint8Array ( [ 1 , 2 , 3 ] ) ;
114+ await writeFile (
115+ path . join ( tempDir , 'sqlite_markdown.so' ) ,
116+ extensionBytes
117+ ) ;
118+ await writeFile (
119+ path . join ( tempDir , 'manifest.json' ) ,
120+ JSON . stringify ( {
121+ name : 'sqlite_markdown' ,
122+ artifacts : [
123+ {
124+ phpVersion : '8.4' ,
125+ sourcePath : 'sqlite_markdown.so' ,
126+ } ,
127+ ] ,
128+ } )
129+ ) ;
130+
131+ const options = await withPHPExtensions ( '8.4' , 'jspi' , { } , [
132+ {
133+ source : {
134+ format : 'manifest' ,
135+ manifestUrl : path . join ( tempDir , 'manifest.json' ) ,
136+ } ,
137+ loadWithIniDirective : false ,
138+ } ,
139+ ] ) ;
140+ const fs = createFakeFS ( ) ;
141+
142+ expect ( options . ENV ?. [ 'PHP_INI_SCAN_DIR' ] ) . toBeUndefined ( ) ;
143+ options . onRuntimeInitialized ?.( { FS : fs } as any ) ;
144+
145+ expect (
146+ fs . files . get ( `${ PHP_EXTENSIONS_DIR } /sqlite_markdown.so` )
147+ ) . toEqual ( extensionBytes ) ;
148+ expect (
149+ fs . files . has ( `${ PHP_EXTENSIONS_DIR } /sqlite_markdown.ini` )
150+ ) . toBe ( false ) ;
151+ } finally {
152+ await rm ( tempDir , { recursive : true , force : true } ) ;
153+ }
154+ } ) ;
155+
108156 it ( 'treats drive-letter-shaped strings as local paths, not URL schemes' , ( ) => {
109157 const source = normalizeNodeExtensionSource ( {
110158 format : 'manifest' ,
0 commit comments