mxunit testing quesion

Here is my issue:
using coldbox and someone added this at the top of the component:

<cfproperty name="queryHelper" type="coldbox:plugin:queryHelper"
scope="instance" />
  instance = structnew();

<!--- Function init --->
<cffunction name="init" returntype="administration" output="false">
  <cfreturn this>

then in the function here is the line of code that is not working:

<cfset getCaseCount.caseCount =
instance.queryHelper.doQueryAppend(qryOtherCases,qryCaseCount) >

the test does not know what queryHelper is, which is the plugin from
coldbox...anyone know how I can reference this in my test?

I have other issues with instances, but this was a totally new issues
I have not run into yet in my test.

Remove this line of code.

instance = structnew();

This is where mocking would come into play.

You would mock the property of the query helper. Here is an example of how to do that in your test setup

component extends="coldbox.system.testing.BaseModelTest" model="model.Case"{

  function setup(){
    user = case;
    mockQueryHelper = getMockBox().createEmptyMock("coldbox.system.plugins.queryHelper ");
    case.$property(propertyName="queryHelper",mock= mockQueryHelper);

Read here for complete information and documentation on mocking.

Also, here for a screen cast of Luis covering the subject.


-- Andrew, can't remove that code, it is part of the model cfc file
and was added before I started doing test...

-- Curt,
we are using coldbox 2.6, so I am not sure if mockbox is part of that
i figure it is not there because user = case; brings an error.

is there any other way to do this, such as getMockPlugin() or some
other way, or is using mockBox the only real way?