Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
lmajano committed May 13, 2024
2 parents ecf6b8c + 81412fc commit e2de094
Show file tree
Hide file tree
Showing 18 changed files with 70 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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: |
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
steps:
# Checkout development
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: development

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
Expand Down
22 changes: 7 additions & 15 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: |
Expand Down
5 changes: 2 additions & 3 deletions .markdownlint.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion box.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name":"TestBox",
"version":"5.3.1",
"version":"5.4.0",
"location":"https://downloads.ortussolutions.com/ortussolutions/testbox/@build.version@/[email protected]@.zip",
"author":"Ortus Solutions <[email protected]>",
"slug":"testbox",
Expand Down
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion [email protected]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"app":{
"cfengine":"adobe@2023.0.0-beta.1",
"cfengine":"adobe@2023",
"serverHomeDirectory":".engine/adobe2023"
},
"name":"testbox-adobe@2023",
Expand Down
2 changes: 1 addition & 1 deletion [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}
},
"app":{
"cfengine":"lucee@6.0.0-SNAPSHOT",
"cfengine":"lucee@6",
"serverHomeDirectory":".engine/lucee6"
},
"cfconfig":{
Expand Down
2 changes: 2 additions & 0 deletions system/BaseSpec.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -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#",
Expand Down
13 changes: 8 additions & 5 deletions system/CollectionExpectation.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
9 changes: 7 additions & 2 deletions system/MockBox.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,12 @@ The Official ColdBox Mocking Factory
/>
<cfargument name="default" required="false" hint="Default value to return if property does not exist"/>
<cfscript>
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 ];
Expand All @@ -304,7 +309,7 @@ The Official ColdBox Mocking Factory
</cfscript>
<cfthrow
type ="MockBox.PropertyDoesNotExist"
message="The property requested #arguments.name# does not exist in the #arguments.scope# scope"
message="The property requested [#arguments.name#] does not exist in the [#arguments.scope#] scope"
>
</cffunction>

Expand Down
2 changes: 1 addition & 1 deletion system/compat/framework/TestCase.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

/**
Expand Down
6 changes: 3 additions & 3 deletions system/reports/BaseReporter.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

Expand Down
6 changes: 5 additions & 1 deletion system/util/MixerUtil.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
6 changes: 3 additions & 3 deletions system/util/Util.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down
15 changes: 15 additions & 0 deletions test-browser/index.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,21 @@
</div>
</div>
<!--- Runners --->
<div class="row">
<div class="col-md-12 mb-4">
<h2>Availble Test Runners: </h2>
<p>
Below is a listing of the runners matching the "runner*.cfm" pattern.
</p>
<cfset runners = directoryList( expandPath( "./" ), false, "query", "runner*.cfm" )>
<cfoutput query="runners">
<a href="#runners.name#" target="_blank" class="btn btn-secondary btn-sm my-1 mx-1">#runners.name#</a>
</cfoutput>
</div>
</div>
<!--- Listing --->
<div class="row">
<div class="col-md-12">
Expand Down
2 changes: 1 addition & 1 deletion tests/specs/mockbox/MockBoxTest.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -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" ) );
}

Expand Down

0 comments on commit e2de094

Please sign in to comment.