You haven't given much to go on! And I'm no testing expert, but...
I think your AppTest would have to fake the environment, i.e provide
values all the fields that your method uses.
Then , you can call your method in the test case, and see if it
returns what you would expect given these dummy values?
On 27 Jun, 22:56, bingo <[EMAIL PROTECTED]> wrote:
> anyone ??
>
> On Jun 27, 10:32 am, bingo <[EMAIL PROTECTED]> wrote:
>
> > Hi all,
>
> > I have a function in AppController and I would like to write a test
> > case for it. In the past, I had written some simple test cases for
> > models but never wrote one for a controller. Can someone help me with
> > writing a test case function for app controller.
>
> > The function (getParams) that I want to test is basically a generic
> > function that other controllers can call to fetch param values either
> > sent via post or get or through php://input parameter.
>
> > Below is the test I have currently. It's currently incomplete
>
> > loadController('App');
> > class AppTest extends AppController{
> > var $name = 'AppTest';
> > }
>
> > class AppControllerTest extends CakeTestCase {
>
> > }
>
> > I am not sure how to move beyond this point.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---