From e703986959edafef986d264197b779a780f1febf Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Tue, 10 Dec 2024 16:36:12 +0100 Subject: [PATCH] TESTBOX-408 Allow toHaveKey to support struct like objects https://ortussolutions.atlassian.net/browse/TESTBOX-408 --- system/Assertion.cfc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/system/Assertion.cfc b/system/Assertion.cfc index 748ad94..a95d961 100644 --- a/system/Assertion.cfc +++ b/system/Assertion.cfc @@ -1454,16 +1454,13 @@ component { * @throws InvalidTargetType - If we can normalize it to a struct */ private function normalizeToStruct( any target ){ - if ( isStruct( arguments.target ) ) { - return arguments.target; - } if ( isQuery( arguments.target ) ) { return getMetadata( arguments.target ).reduce( ( results, item ) => { results[ item.name ] = {}; return results; }, {} ); } - throw( "InvalidTargetType", "The target is not a struct or query" ); + return arguments.target; } }