diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 540017d..8f2e27f 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Checkout Repository - uses: actions/checkout@v3.2.0 + uses: actions/checkout@v4 - uses: Ortus-Solutions/commandbox-action@v1.0.2 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1926d6a..2c64760 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,10 +26,10 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Java - uses: actions/setup-java@v3.9.0 + uses: actions/setup-java@v4 with: distribution: "temurin" java-version: "11" @@ -85,7 +85,7 @@ jobs: - name: Upload Build Artifacts if: success() - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v4 with: name: testbox path: | @@ -153,7 +153,7 @@ jobs: steps: # Checkout development - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: development diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 238c8ff..dc45147 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -20,7 +20,7 @@ jobs: name: Code Auto-Formatting runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Auto-format uses: Ortus-Solutions/commandbox-action@v1.0.2 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0af0e93..db56b7b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,30 +15,22 @@ jobs: strategy: fail-fast: false matrix: - commandbox_version: [ "5.9.0" ] - cfengine: [ "lucee@5", "adobe@2018", "adobe@2021" ] - jdkVersion: [ "8", "11" ] + commandbox_version: [ "6.0.1" ] + cfengine: [ "lucee@5", "lucee@6", "adobe@2018", "adobe@2021", "adobe@2023" ] + jdkVersion: [ "11" ] experimental: [false] include: - cfengine: "lucee@6" - commandbox_version: "6.0.0-alpha" - jdkVersion: "11" - experimental: true - - cfengine: "lucee@6" - commandbox_version: "6.0.0-alpha" + commandbox_version: "6.0.1" jdkVersion: "17" experimental: true - cfengine: "adobe@2023" - commandbox_version: "6.0.0-alpha" - jdkVersion: "11" - experimental: true - - cfengine: "adobe@2023" - commandbox_version: "6.0.0-alpha" + commandbox_version: "6.0.1" jdkVersion: "17" experimental: true steps: - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Java uses: actions/setup-java@v3 @@ -86,7 +78,7 @@ jobs: - name: Upload Debugging Info To Artifacts if: ${{ failure() }} - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v4 with: name: Failure Debugging Info - ${{ matrix.cfengine }} - ${{ matrix.jdkVersion }} path: | diff --git a/.markdownlint.json b/.markdownlint.json index 3707fcb..cd13022 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -8,8 +8,7 @@ "no-multiple-blanks": { "maximum": 2 }, - "no-duplicate-header" : { - "siblings_only" : true - }, + "no-duplicate-header" : false, + "no-duplicate-heading" : false, "no-inline-html" : false } diff --git a/box.json b/box.json index 08e0632..ca49c81 100644 --- a/box.json +++ b/box.json @@ -1,6 +1,6 @@ { "name":"TestBox", - "version":"5.3.1", + "version":"5.4.0", "location":"https://downloads.ortussolutions.com/ortussolutions/testbox/@build.version@/testbox-@build.version@.zip", "author":"Ortus Solutions ", "slug":"testbox", diff --git a/changelog.md b/changelog.md index 1651db7..41a96ee 100644 --- a/changelog.md +++ b/changelog.md @@ -9,6 +9,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Improvement + +- [TESTBOX-385](https://ortussolutions.atlassian.net/browse/TESTBOX-385) Remove all unsafe references to evaluate +- [TESTBOX-386](https://ortussolutions.atlassian.net/browse/TESTBOX-386) Add lists of runners to Browser Page +- [TESTBOX-387](https://ortussolutions.atlassian.net/browse/TESTBOX-387) more compats on engine detection +- [TESTBOX-388](https://ortussolutions.atlassian.net/browse/TESTBOX-388) Adobe 2023 / Lucee 6 Certification + ## [5.3.1] - 2023-09-13 ### Fixed diff --git a/server-adobe@2023.json b/server-adobe@2023.json index 21d485e..cc4bbdc 100644 --- a/server-adobe@2023.json +++ b/server-adobe@2023.json @@ -1,6 +1,6 @@ { "app":{ - "cfengine":"adobe@2023.0.0-beta.1", + "cfengine":"adobe@2023", "serverHomeDirectory":".engine/adobe2023" }, "name":"testbox-adobe@2023", diff --git a/server-lucee@6.json b/server-lucee@6.json index d5df1c5..168965d 100644 --- a/server-lucee@6.json +++ b/server-lucee@6.json @@ -9,7 +9,7 @@ } }, "app":{ - "cfengine":"lucee@6.0.0-SNAPSHOT", + "cfengine":"lucee@6", "serverHomeDirectory":".engine/lucee6" }, "cfconfig":{ diff --git a/system/BaseSpec.cfc b/system/BaseSpec.cfc index c479c8b..e538489 100644 --- a/system/BaseSpec.cfc +++ b/system/BaseSpec.cfc @@ -870,8 +870,10 @@ component { string labels = "" ) output=true{ setting requesttimeout=99999999; + // content type defaulted, to avoid dreaded wddx default getPageContext().getResponse().setContentType( "text/html" ); + // run tests var runner = new testbox.system.TestBox( bundles : "#getMetadata( this ).name#", diff --git a/system/CollectionExpectation.cfc b/system/CollectionExpectation.cfc index 6934122..aaed522 100644 --- a/system/CollectionExpectation.cfc +++ b/system/CollectionExpectation.cfc @@ -36,16 +36,19 @@ component accessors="true" { function onMissingMethod( string missingMethodName, any missingMethodArguments ){ if ( isArray( variables.actual ) ) { for ( var e in variables.actual ) { - // Using evaluate since invoke looses track of positional argument collections - evaluate( - "variables.spec.expect( e ).#arguments.missingMethodName#( argumentCollection=arguments.missingMethodArguments )" + invoke( + variables.spec.expect( e ), + arguments.missingMethodName, + arguments.missingMethodArguments ); } } else if ( isStruct( variables.actual ) ) { for ( var k in variables.actual ) { var e = variables.actual[ k ]; - evaluate( - "variables.spec.expect( e ).#arguments.missingMethodName#( argumentCollection=arguments.missingMethodArguments )" + invoke( + variables.spec.expect( e ), + arguments.missingMethodName, + arguments.missingMethodArguments ); } } else { diff --git a/system/MockBox.cfc b/system/MockBox.cfc index 299b4aa..0fdb371 100644 --- a/system/MockBox.cfc +++ b/system/MockBox.cfc @@ -292,7 +292,12 @@ The Official ColdBox Mocking Factory /> - var thisScope = evaluate( "#arguments.scope#" ); + var thisScope = variables; + if ( arguments.scope == "this" ) { + thisScope = this; + } else if ( !isNull( variables ) && variables.keyExists( arguments.scope ) ) { + thisScope = variables[ arguments.scope ]; + } if ( structKeyExists( thisScope, arguments.name ) ) { return thisScope[ arguments.name ]; @@ -304,7 +309,7 @@ The Official ColdBox Mocking Factory diff --git a/system/compat/framework/TestCase.cfc b/system/compat/framework/TestCase.cfc index 3394282..5737102 100644 --- a/system/compat/framework/TestCase.cfc +++ b/system/compat/framework/TestCase.cfc @@ -393,7 +393,7 @@ component extends="testbox.system.BaseSpec" { * Assert something is defined or not */ function assertIsDefined( required o, message = "" ){ - this.$assert.isTrue( isDefined( evaluate( "arguments.o" ) ), arguments.message ); + this.$assert.isTrue( isDefined( "#arguments.o#" ), arguments.message ); } /** diff --git a/system/reports/BaseReporter.cfc b/system/reports/BaseReporter.cfc index 40d2560..acdb594 100644 --- a/system/reports/BaseReporter.cfc +++ b/system/reports/BaseReporter.cfc @@ -17,10 +17,10 @@ component { * Helper method to deal with ACF2016's overload of the page context response, come on Adobe, get your act together! */ function getPageContextResponse(){ - if ( structKeyExists( server, "lucee" ) ) { - return getPageContext().getResponse(); - } else { + if ( server.keyExists( "coldfusion" ) && server.coldfusion.productName.findNoCase( "ColdFusion" ) ) { return getPageContext().getResponse().getResponse(); + } else { + return getPageContext().getResponse(); } } diff --git a/system/util/MixerUtil.cfc b/system/util/MixerUtil.cfc index c0deb42..11f9697 100644 --- a/system/util/MixerUtil.cfc +++ b/system/util/MixerUtil.cfc @@ -164,7 +164,11 @@ component accessors="true" { * Removes a method in a CFC */ function removePropertyMixin( required propertyName, scope = "variables" ){ - structDelete( evaluate( arguments.scope ), arguments.propertyName ); + if ( arguments.scope eq "variables" ) { + structDelete( variables, arguments.propertyName ); + } else { + structDelete( this, arguments.propertyName ); + } return this; } diff --git a/system/util/Util.cfc b/system/util/Util.cfc index 50be0e0..da33219 100644 --- a/system/util/Util.cfc +++ b/system/util/Util.cfc @@ -108,10 +108,10 @@ component { * Check if you are in cfthread or not for any CFML Engine */ boolean function inThread(){ - var engine = "ADOBE"; + var engine = "LUCEE"; - if ( server.coldfusion.productname eq "Lucee" ) { - engine = "LUCEE"; + if ( server.keyExists( "coldfusion" ) && server.coldfusion.productname.findNoCase( "ColdFusion" ) ) { + engine = "ADOBE"; } switch ( engine ) { diff --git a/test-browser/index.cfm b/test-browser/index.cfm index 40671ea..494231b 100644 --- a/test-browser/index.cfm +++ b/test-browser/index.cfm @@ -77,6 +77,21 @@ + +
+
+

Availble Test Runners:

+

+ Below is a listing of the runners matching the "runner*.cfm" pattern. +

+ + + + #runners.name# + +
+
+
diff --git a/tests/specs/mockbox/MockBoxTest.cfc b/tests/specs/mockbox/MockBoxTest.cfc index 5acfc0f..8ad1d37 100755 --- a/tests/specs/mockbox/MockBoxTest.cfc +++ b/tests/specs/mockbox/MockBoxTest.cfc @@ -401,7 +401,7 @@ $assert.isEqual( "Majano", mock.$getProperty( name = "luis", scope = "this" ) ); $assert.isEqual( true, mock.$getProperty( name = "cool" ) ); $assert.isEqual( true, mock.$getProperty( name = "cool", scope = "variables" ) ); - $assert.isEqual( 7, mock.$getProperty( name = "number", scope = "variables.instance" ) ); + $assert.isEqual( 7, mock.$getProperty( name = "number", scope = "instance" ) ); $assert.isEqual( 7, mock.$getProperty( name = "number", scope = "instance" ) ); }