[coldbox-3.5.1] BaseModelTest doesn't know getWireBox()

20 views
Skip to first unread message

Tanja Zogg

unread,
May 24, 2012, 5:44:03 AM5/24/12
to col...@googlegroups.com
hi there

i'm quite new to coldbox. i wanted to write a test-class, extending coldbox.system.testing.BaseModelTest. in the setup-function i can use getMockBox(), that works, but i need getWireBox(), too and that one returns an error that the method was not found. according to the apidocs it should exist, though. or did i get something wrong?

in my config-file i have wirebox turned on:

wireBox = {
            enabled = true,
            //binder="config.WireBox",
            singletonReload=true
        };

does anyone have any idea, what i'm doing wrong?

tanks in advance

tanja

Luis Majano

unread,
May 24, 2012, 5:55:55 PM5/24/12
to col...@googlegroups.com
Tanja,

You are using the "BaseModelTest", which means you are testing your model CFC's in isolation, meaning nothing in your ColdBox application is linked.  However, if you read the docs, when you use the BaseModelTest, we create some variables for you in the "variables" scope


You can use the mockWireBox variable to mock whatever dependency you need.
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To post to this group, send email to col...@googlegroups.com
To unsubscribe from this group, send email to coldbox-u...@googlegroups.com
For more options, visit this group at http://groups-beta.google.com/group/coldbox
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org

Tanja Zogg

unread,
May 30, 2012, 5:17:54 AM5/30/12
to ColdBox Platform
Thanks a lot Luis, now it works!

On 24 Mai, 23:55, Luis Majano <lmaj...@gmail.com> wrote:
> Tanja,
>
> You are using the "BaseModelTest", which means you are testing your model CFC's in isolation, meaning nothing in your ColdBox application is linked.  However, if you read the docs, when you use the BaseModelTest, we create some variables for you in the "variables" scope
>
> http://wiki.coldbox.org/wiki/Testing.cfm#Model_Object_Testing
>
> You can use the mockWireBox variable to mock whatever dependency you need.
>
> Luis F. Majano
> CEO
> Ortus Solutions, Corpwww.ortussolutions.com(http://www.ortussolutions.com)
> Social: twitter.com/lmajano (http://twitter.com/lmajano) facebook.com/lmajano (http://facebook.com/lmajano)
>
>
>
>
>
>
>
> On Thursday, May 24, 2012 at 2:44 AM, Tanja Zogg wrote:
> > hi there
>
> > i'm quite new to coldbox. i wanted to write a test-class, extending coldbox.system.testing.BaseModelTest. in the setup-function i can use getMockBox(), that works, but i need getWireBox(), too and that one returns an error that the method was not found. according to the apidocs it should exist, though. or did i get something wrong?
>
> > in my config-file i have wirebox turned on:
>
> > wireBox = {
> >             enabled = true,
> >             //binder="config.WireBox",
> >             singletonReload=true
> >         };
>
> > does anyone have any idea, what i'm doing wrong?
>
> > tanks in advance
>
> > tanja
> > --
> > You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
> > To post to this group, send email to col...@googlegroups.com (mailto:col...@googlegroups.com)
> > To unsubscribe from this group, send email to coldbox-u...@googlegroups.com (mailto:coldbox-u...@googlegroups.com)
Reply all
Reply to author
Forward
0 new messages