Mockbox $property method argument order wrong

We've been trying to get our unit testing running and have encountered
numerous examples showing the use of the MockBox $property method with
this (unnamed) argument order: propertyName, mock, propertyScope - but
the MockBox.cfc has this argument order: properyName, propertyScope,
mock.

At this point we are really not getting very far since there appear to
many examples for unit testing but "will the real current one that
works please stand up?"

So if anyone can point to the definitive article that matches the
current ColdBox release and covers mocking for testing a service that
would be great. We understand where this is trying to go and we want
to go there too but right now we are don't seem to have all the
matching bits and pieces together in one place.

Regards

I used the following coldbox wiki entry to get up to speed and
everything seems to be correct:

http://wiki.coldbox.org/wiki/MockBox.cfm#.24property()

Dominic

Thanks for that Dominic

One question is where do I put my test.cfc or rather where should and
shouldn't I put my cfc.

I think it should go in a testing folder in the root of my app but I'm
not confident that I'm not just incorrectly continuing to use a folder
structure from a now obsolete example. What I don't want to get into
again is a situation where I have something that looks like it works
but then discover that as I expand its capabilities it doesn't work
anymore because I got the fundamentals wrong.

It may say it in the page you gave me but I'm pretty sure I haven't
found a specific reference.

A little bit more - I've ploughed on regardless and created the
test.cfc from the example in a "testing" folder.

I've had to work out that you need an Application.cfc in the folder
and that the url to call the component also needs to have ?
method=runtestremote included.and now I'm at a point where it can't
find MockBox() so I'll do more digging. I guess I'm saying that this
page has some useful information but it isn't a great first
introduction to ColdBox testing, it feels like it requires a great
deal of ColdBox knowledge to implement.

OK more info -

I need to put the import coldbox.system.testing.*; inside the
component before the first method - in the example it is at the top
and this appears to prevent it from running (Railo 3.2.1 Final).

It appears use of the cfimport tag in the example position is not
permitted in CF8 - actually I'm having trouble cfimporting the
coldbox.system.testing folder (.*) in any position in a cfc.

If this is the case then the Example's System Requirements would need
to change.

If anyone has a working example of both or either of the tag or script
version of cfimport/import in a CF8 component that would be great -
don't forget the example imports the contents of a folder not just one
cfc e.g. import coldbox.system.testing.*;.

Using cfimport/import in this manner is a ColdFusion 9 only feature, not
ColdFusion 8.

Regards,
Andrew Scott
http://www.andyscott.id.au/

From: coldbox@googlegroups.com [mailto:coldbox@googlegroups.com] On
Behalf Of Martin
Sent: Thursday, 3 March 2011 5:29 PM
To: ColdBox Platform
Subject: [coldbox:8518] Re: Mockbox $property method argument order
wrong

It appears use of the cfimport tag in the example position is not

permitted in

CF8 - actually I'm having trouble cfimporting the coldbox.system.testing
folder (.*) in any position in a cfc.

If this is the case then the Example's System Requirements would need to
change.

If anyone has a working example of both or either of the tag or script

version

of cfimport/import in a CF8 component that would be great - don't forget

the

Thanks Andrew, I guess the examples on the http://wiki.coldbox.org/wiki/MockBox.cfm#.24property()
page are ColdFusion 9+

No those examples are just cfscript, and should work in CFMX 6/7/8/9.

Regards,
Andrew Scott
http://www.andyscott.id.au/