Tuesday, December 29, 2009

Re: testing a controller's add action

Thanks for all the information!

Let's see how testing is in the next release, and in particular the
documentation; as for proposing an alternative in the book I guess I
should file a ticket, right?

For the moment I'm testing controllers' actions the "hard way" :)

cheers
Lorenzo

nurvzy wrote:
> Lorenzo Bettini <bett...@dsi.unifi.it> wrote:
>> I'm not getting errors: as I said before, I can see that data is not
>> populated using the debugger, and also because it executes the
>> instructions to be executed when data is null; thus it basically does
>> not faulter, it simply does not get any data... can it be a bug?
>
> It's possible, I never had a whole lot of luck with testAction other
> than just really basic tests, as such I almost never use it. It's
> possible we're missing something really simple. /shrug. testAction
> does a lot of the 'magic' on it own, but I prefer doing things in such
> a way I have complete control over the test -- less surprises that
> way. I read, in 1.3/2.0 the testsuite is getting a major makeover.
>
>> yes, with the instructions in this post I can successfully test mycontroller'sadd and edit actions.
>>
>> But I guess the documentation of cakephp should be updated to include
>> such way oftestingcontrollers, especially since testAction, as you
>> also noticed, is not powerful enough (and probably buggy due to the
>> missing data ;)
>
> I agree, I like the way Mark tests his controllers, it makes a lot
> more sense to me. If you're feeling generous go ahead and post an
> alternative in the Book, they always like people helping them make the
> documentation better.
>

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: