Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 27 additions & 29 deletions system/TestBox.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -408,21 +408,20 @@ component accessors="true" {
// The `url` scope only exists in a real HTTP request - it isn't registered at all when
// TestBox runs via the BoxLang CLI, so even a `structKeyExists( url, ... )` guard throws
// (resolving the bare `url` identifier is what fails, not the key lookup within it).
// `isDefined()` is the safe way to probe for scope existence without that risk, so
// don't just skip on IS_CLI - only skip when the scope truly isn't there.
if ( !variables.IS_CLI || isDefined( "url" ) ) {
if ( structKeyExists( url, "testBundles" ) && !isNull( url.testBundles ) ) {
testBundles.append( listToArray( urlDecode( url.testBundles ) ), true );
}
if ( structKeyExists( url, "testSuites" ) && !isNull( url.testSuites ) ) {
arguments.testSuites.append( listToArray( urlDecode( url.testSuites ) ), true );
}
if ( structKeyExists( url, "testSpecs" ) && !isNull( url.testSpecs ) ) {
arguments.testSpecs.append( listToArray( urlDecode( url.testSpecs ) ), true );
}
if ( structKeyExists( url, "testMethod" ) && !isNull( url.testMethod ) ) {
arguments.testSpecs.append( listToArray( urlDecode( url.testMethod ) ), true );
}
// Param it to an empty struct so it's always safe to touch below - a no-op everywhere
// the scope already exists (every engine, every non-CLI request).
param name="url" default={};
if ( structKeyExists( url, "testBundles" ) && !isNull( url.testBundles ) ) {
testBundles.append( listToArray( urlDecode( url.testBundles ) ), true );
}
if ( structKeyExists( url, "testSuites" ) && !isNull( url.testSuites ) ) {
arguments.testSuites.append( listToArray( urlDecode( url.testSuites ) ), true );
}
if ( structKeyExists( url, "testSpecs" ) && !isNull( url.testSpecs ) ) {
arguments.testSpecs.append( listToArray( urlDecode( url.testSpecs ) ), true );
}
if ( structKeyExists( url, "testMethod" ) && !isNull( url.testMethod ) ) {
arguments.testSpecs.append( listToArray( urlDecode( url.testMethod ) ), true );
}

// Using a directory runner?
Expand Down Expand Up @@ -531,20 +530,19 @@ component accessors="true" {
isSimpleValue( arguments.testSpecs ) ? listToArray( arguments.testSpecs ) : arguments.testSpecs
);

// The `url` scope only exists in a real HTTP request - see the identical guard in runRaw().
if ( !variables.IS_CLI || isDefined( "url" ) ) {
if ( structKeyExists( url, "testBundles" ) && !isNull( url.testBundles ) ) {
arguments.testBundles.append( listToArray( urlDecode( url.testBundles ) ), true );
}
if ( structKeyExists( url, "testSuites" ) && !isNull( url.testSuites ) ) {
arguments.testSuites.append( listToArray( urlDecode( url.testSuites ) ), true );
}
if ( structKeyExists( url, "testSpecs" ) && !isNull( url.testSpecs ) ) {
arguments.testSpecs.append( listToArray( urlDecode( url.testSpecs ) ), true );
}
if ( structKeyExists( url, "testMethod" ) && !isNull( url.testMethod ) ) {
arguments.testSpecs.append( listToArray( urlDecode( url.testMethod ) ), true );
}
// The `url` scope only exists in a real HTTP request - see the identical param in runRaw().
param name="url" default={};
if ( structKeyExists( url, "testBundles" ) && !isNull( url.testBundles ) ) {
arguments.testBundles.append( listToArray( urlDecode( url.testBundles ) ), true );
}
if ( structKeyExists( url, "testSuites" ) && !isNull( url.testSuites ) ) {
arguments.testSuites.append( listToArray( urlDecode( url.testSuites ) ), true );
}
if ( structKeyExists( url, "testSpecs" ) && !isNull( url.testSpecs ) ) {
arguments.testSpecs.append( listToArray( urlDecode( url.testSpecs ) ), true );
}
if ( structKeyExists( url, "testMethod" ) && !isNull( url.testMethod ) ) {
arguments.testSpecs.append( listToArray( urlDecode( url.testMethod ) ), true );
}

var filterState = new testbox.system.TestResult(
Expand Down
Loading