@@ -235,6 +235,21 @@ describe('Command Generation Tests', () => {
235235 } , 200000 )
236236
237237 it ( 'properly quotes copy pattern' , async ( ) => {
238+ mocks . getInputMock . mockImplementation ( name => {
239+ if ( name === 'trial' ) return 'true'
240+ if ( name === 'copy' ) return '*.txt'
241+ return ''
242+ } )
243+
244+ await main . run ( )
245+
246+ const encodingCommand = capturedCommands . find ( cmd =>
247+ cmd . includes ( 'ioncube_encoder' )
248+ )
249+ expect ( encodingCommand ) . toContain ( '--copy "*.txt"' )
250+ } , 200000 )
251+
252+ it ( 'generates multiple --copy flags for space-separated patterns' , async ( ) => {
238253 mocks . getInputMock . mockImplementation ( name => {
239254 if ( name === 'trial' ) return 'true'
240255 if ( name === 'copy' ) return '*.txt *.md'
@@ -246,7 +261,56 @@ describe('Command Generation Tests', () => {
246261 const encodingCommand = capturedCommands . find ( cmd =>
247262 cmd . includes ( 'ioncube_encoder' )
248263 )
249- expect ( encodingCommand ) . toContain ( '--copy "*.txt *.md"' )
264+ expect ( encodingCommand ) . toContain ( '--copy "*.txt"' )
265+ expect ( encodingCommand ) . toContain ( '--copy "*.md"' )
266+ } , 200000 )
267+
268+ it ( 'generates multiple --encrypt flags for space-separated patterns' , async ( ) => {
269+ mocks . getInputMock . mockImplementation ( name => {
270+ if ( name === 'trial' ) return 'true'
271+ if ( name === 'encrypt' ) return '*.blade.php *.env.example'
272+ return ''
273+ } )
274+
275+ await main . run ( )
276+
277+ const encodingCommand = capturedCommands . find ( cmd =>
278+ cmd . includes ( 'ioncube_encoder' )
279+ )
280+ expect ( encodingCommand ) . toContain ( '--encrypt "*.blade.php"' )
281+ expect ( encodingCommand ) . toContain ( '--encrypt "*.env.example"' )
282+ } , 200000 )
283+
284+ it ( 'generates multiple --ignore flags for space-separated patterns' , async ( ) => {
285+ mocks . getInputMock . mockImplementation ( name => {
286+ if ( name === 'trial' ) return 'true'
287+ if ( name === 'ignore' ) return '*/cache/* */logs/*'
288+ return ''
289+ } )
290+
291+ await main . run ( )
292+
293+ const encodingCommand = capturedCommands . find ( cmd =>
294+ cmd . includes ( 'ioncube_encoder' )
295+ )
296+ expect ( encodingCommand ) . toContain ( '--ignore "*/cache/*"' )
297+ expect ( encodingCommand ) . toContain ( '--ignore "*/logs/*"' )
298+ } , 200000 )
299+
300+ it ( 'generates multiple --skip flags for space-separated patterns' , async ( ) => {
301+ mocks . getInputMock . mockImplementation ( name => {
302+ if ( name === 'trial' ) return 'true'
303+ if ( name === 'skip' ) return '*/vendor/* */node_modules/*'
304+ return ''
305+ } )
306+
307+ await main . run ( )
308+
309+ const encodingCommand = capturedCommands . find ( cmd =>
310+ cmd . includes ( 'ioncube_encoder' )
311+ )
312+ expect ( encodingCommand ) . toContain ( '--skip "*/vendor/*"' )
313+ expect ( encodingCommand ) . toContain ( '--skip "*/node_modules/*"' )
250314 } , 200000 )
251315
252316 it ( 'properly quotes ignore pattern' , async ( ) => {
@@ -439,7 +503,7 @@ describe('Command Generation Tests', () => {
439503 expect ( encodingCommand ) . toContain ( '--allow-reflection-all' )
440504 } , 200000 )
441505
442- it ( 'includes --allow-reflection with pattern' , async ( ) => {
506+ it ( 'includes --allow-reflection with single pattern' , async ( ) => {
443507 mocks . getInputMock . mockImplementation ( name => {
444508 if ( name === 'trial' ) return 'true'
445509 if ( name === 'allow-reflection' ) return 'MyClass::*'
@@ -453,6 +517,22 @@ describe('Command Generation Tests', () => {
453517 )
454518 expect ( encodingCommand ) . toContain ( '--allow-reflection MyClass::*' )
455519 } , 200000 )
520+
521+ it ( 'generates multiple --allow-reflection flags for space-separated patterns' , async ( ) => {
522+ mocks . getInputMock . mockImplementation ( name => {
523+ if ( name === 'trial' ) return 'true'
524+ if ( name === 'allow-reflection' ) return 'MyClass::* AnotherClass::method'
525+ return ''
526+ } )
527+
528+ await main . run ( )
529+
530+ const encodingCommand = capturedCommands . find ( cmd =>
531+ cmd . includes ( 'ioncube_encoder' )
532+ )
533+ expect ( encodingCommand ) . toContain ( '--allow-reflection MyClass::*' )
534+ expect ( encodingCommand ) . toContain ( '--allow-reflection AnotherClass::method' )
535+ } , 200000 )
456536 } )
457537
458538 describe ( 'License Flags' , ( ) => {
0 commit comments