[Testbox 3.1.0+339] Error When Executing Post() on ACF 2016

Hello CFers,

I’m building out some integration tests on an ACF 2016 app. When I execute the post() method in my tests, I am getting the following error in the testbox runner:

Entity has incorrect type for being called as a function

The symbol you provided request is not the name of a function.

Screenshot:




The error does not occur if I run my tests in Lucee.

Here is what my test looks like:

`

it( “will throw an error on invalid echo method”, function(){

var event = this.post( “/api/v1/echo/” );
var response = event.getPrivateValue( “response” );

expect( response.getError() ).toBeTrue();
expect( response.getStatusCode() ).toBe( 405 );

});

`

I wanted to debug this problem further, but I can’t figure out where testbox methods like post(), get(), etc… are documented. The closest thing I have found is in the ColdBox documentation where it describes the execute() method here:
https://coldbox.ortusbooks.com/testing/testing-coldbox-applications/integration-testing/the-execute-method

However, having access to methods like post() makes testing much easier. Is there a way I can use methods like post() in ACF?

Side note for reference, here are the dependencies from my box.json file:

`

“devDependencies”:{
“relax”:"^4",
“testbox”:"^3.0.0",
“commandbox-dotenv”:"",
“commandbox-cfconfig”:"
",
“commandbox-cfformat”:"*",
“route-visualizer”:"^1.2.0+4"
},
“dependencies”:{
“coldbox”:"^5.0.0",
“cbswagger”:"^2.0.0",
“cbvalidation”:"^1.5.1+78",
“qb”:"^6.5.0",
“BCrypt”:"^2.5.0-snapshot",
“mementifier”:"^2.0.0-snapshot",
“cbsecurity”:"^2.1.0+66"
},

`

Thank you for taking the time to help me with this issue.

I think I just figured out the problem so I am posting here for posterity:

If I look at where the error occurs: /coldbox/system/testing/BaseTestCase.cfc, the method post() calls request(), and I believe this is a reserved word in ACF 2016.

If I change line 567 from:
return request( argumentCollection = arguments );
to
return this.request( argumentCollection = arguments );

It looks like this issue was fixed by Elpete back in October but hasn’t been pushed to an official release yet.