When using TestBox (v4.5.0+5) I all of a sudden ge...
# box-products
s
When using TestBox (v4.5.0+5) I all of a sudden get an exception (all it says is
returntype
) (source
testbox\system\MockBox.cfc:681). Anyone run into this?
The issues seems to occur when I try to mock out the
returning
method of the QueryBuilder instance (qb) in my test method.
For some reason, the
getMetadata()
call for the function
returning
returns a Java object, b/c the value of
variables["returning"]
is an array (
[]
).
@bdw429s, @elpete any thoughts on how I can resolve this?
At this point i "hacked" MockBox.cfc by inserting the following code (line 679):
Copy code
// Not a struct, something went wrong
if( !isStruct( fncMD ) ) {
  fncMD = {};
}
e
Not sure. I generally avoid mocking Quick.
s
It's not quick i'm using, it's qb.
e
Same thing under the hood. 😅
😄 1
s
Issuing a pull request with my "quick fix" would be overkill i presume?
b
@satauros What CF engine version is this?
Also, I'm not quite following this:
For some reason, the
getMetadata()
call for the function
returning
returns a Java object, b/c the value of
variables["returning"]
is an array (
[]
).
Are you saying
returning
is a UDF or an array? Because it can't be both.
s
@bdw429s using
adobe@2016
, testbox 4.5.0+5. I've added some screenshots in my gist to illustrate what's wrong => https://gist.github.com/satauros/8b4a9e16f2c7a3afd946b966e0431120
b
@satauros This is all I see at that link
s
🫤 yeah so apparently I did not push the save button in that case... I'll try to upload them asap. Sorry for the inconvenience
😜 1
@bdw429s I've updated the gist with the images 😛.
Fyi, it works on Lucee 🙂
b
I see the screenshots, but I'll be honest I'm not really following what all is supposed to be going on there. Do you have a standalone repro case that shows this error?
s
I think i could reprodruce this error in a dummy repo.
All i'm trying to do is mock out the qb dependency btw.
@bdw429s I have a reproduction case available. Edit: I created a github repository (private), I have invited you 🙂.
👍 1