@@ -408,21 +408,20 @@ component accessors="true" {
408408 // The `url` scope only exists in a real HTTP request - it isn't registered at all when
409409 // TestBox runs via the BoxLang CLI, so even a `structKeyExists( url, ... )` guard throws
410410 // (resolving the bare `url` identifier is what fails, not the key lookup within it).
411- // `isDefined()` is the safe way to probe for scope existence without that risk, so
412- // don't just skip on IS_CLI - only skip when the scope truly isn't there.
413- if ( ! variables .IS_CLI || isDefined ( " url" ) ) {
414- if ( structKeyExists ( url , " testBundles" ) && ! isNull ( url .testBundles ) ) {
415- testBundles .append ( listToArray ( urlDecode ( url .testBundles ) ), true );
416- }
417- if ( structKeyExists ( url , " testSuites" ) && ! isNull ( url .testSuites ) ) {
418- arguments .testSuites .append ( listToArray ( urlDecode ( url .testSuites ) ), true );
419- }
420- if ( structKeyExists ( url , " testSpecs" ) && ! isNull ( url .testSpecs ) ) {
421- arguments .testSpecs .append ( listToArray ( urlDecode ( url .testSpecs ) ), true );
422- }
423- if ( structKeyExists ( url , " testMethod" ) && ! isNull ( url .testMethod ) ) {
424- arguments .testSpecs .append ( listToArray ( urlDecode ( url .testMethod ) ), true );
425- }
411+ // Param it to an empty struct so it's always safe to touch below - a no-op everywhere
412+ // the scope already exists (every engine, every non-CLI request).
413+ param name = " url" default = {};
414+ if ( structKeyExists ( url , " testBundles" ) && ! isNull ( url .testBundles ) ) {
415+ testBundles .append ( listToArray ( urlDecode ( url .testBundles ) ), true );
416+ }
417+ if ( structKeyExists ( url , " testSuites" ) && ! isNull ( url .testSuites ) ) {
418+ arguments .testSuites .append ( listToArray ( urlDecode ( url .testSuites ) ), true );
419+ }
420+ if ( structKeyExists ( url , " testSpecs" ) && ! isNull ( url .testSpecs ) ) {
421+ arguments .testSpecs .append ( listToArray ( urlDecode ( url .testSpecs ) ), true );
422+ }
423+ if ( structKeyExists ( url , " testMethod" ) && ! isNull ( url .testMethod ) ) {
424+ arguments .testSpecs .append ( listToArray ( urlDecode ( url .testMethod ) ), true );
426425 }
427426
428427 // Using a directory runner?
@@ -531,20 +530,19 @@ component accessors="true" {
531530 isSimpleValue ( arguments .testSpecs ) ? listToArray ( arguments .testSpecs ) : arguments .testSpecs
532531 );
533532
534- // The `url` scope only exists in a real HTTP request - see the identical guard in runRaw().
535- if ( ! variables .IS_CLI || isDefined ( " url" ) ) {
536- if ( structKeyExists ( url , " testBundles" ) && ! isNull ( url .testBundles ) ) {
537- arguments .testBundles .append ( listToArray ( urlDecode ( url .testBundles ) ), true );
538- }
539- if ( structKeyExists ( url , " testSuites" ) && ! isNull ( url .testSuites ) ) {
540- arguments .testSuites .append ( listToArray ( urlDecode ( url .testSuites ) ), true );
541- }
542- if ( structKeyExists ( url , " testSpecs" ) && ! isNull ( url .testSpecs ) ) {
543- arguments .testSpecs .append ( listToArray ( urlDecode ( url .testSpecs ) ), true );
544- }
545- if ( structKeyExists ( url , " testMethod" ) && ! isNull ( url .testMethod ) ) {
546- arguments .testSpecs .append ( listToArray ( urlDecode ( url .testMethod ) ), true );
547- }
533+ // The `url` scope only exists in a real HTTP request - see the identical param in runRaw().
534+ param name = " url" default = {};
535+ if ( structKeyExists ( url , " testBundles" ) && ! isNull ( url .testBundles ) ) {
536+ arguments .testBundles .append ( listToArray ( urlDecode ( url .testBundles ) ), true );
537+ }
538+ if ( structKeyExists ( url , " testSuites" ) && ! isNull ( url .testSuites ) ) {
539+ arguments .testSuites .append ( listToArray ( urlDecode ( url .testSuites ) ), true );
540+ }
541+ if ( structKeyExists ( url , " testSpecs" ) && ! isNull ( url .testSpecs ) ) {
542+ arguments .testSpecs .append ( listToArray ( urlDecode ( url .testSpecs ) ), true );
543+ }
544+ if ( structKeyExists ( url , " testMethod" ) && ! isNull ( url .testMethod ) ) {
545+ arguments .testSpecs .append ( listToArray ( urlDecode ( url .testMethod ) ), true );
548546 }
549547
550548 var filterState = new testbox .system .TestResult (
0 commit comments