Hi everybody

I'm trying to create useful web tests for an application I didn't
develop (I certainly would have done it in Rails, not in
CakePHP ;-) ), and I'm quite frustrated with the possibilities that
CakePHP's simple integration of SimpleTest offers me...

What I want is to write a test that creates (let's say) an article,
then displays and removes it.

The problem here is that I don't know what ID a newly created article
has. So I have to find ways how to overcome that.

I read somewhere a solution that reads the whole page and scans for
available ID's, but that seems rather clumsy to me.

As far as I know CakePHP's web testing doesn't offer the use of
fixtures, so I also can't just remove one of them to test removal of
an article.

So I got the following idea...

If I could specify the ID of a newly created article, I would know it
from the beginning and could remove it without any problem. But how
could that be achieved?

I could just offer a text input field in every form! But for every
normal and *not* testing use this would be quite strange, so it would
be nice if I could only display the field in testing mode.

So...

1) Do you think this is a good idea?
2) Is there a way to check whether the website is rendered in testing
mode?
3) Is there a better solution (maybe I'm wrong and there really *are*
fixtures available in web testing?)?

Thanks a lot for your thoughts and hints..
Josh

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 [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

Reply via email to