Hi everybody

I wonder why the development, test and production environments seem to
be *not* really separated things in CakePHP?

I want to do the following:
I'm writing web tests for my web application using CakeWebTestCase.
Let's say I'm programming the SimpleTest browser to open users/add,
enter some data into the form, pressing the submit button, verify that
the string "User successfully created" is displayed on the next page,
and press "Crearte User" again (because I expect the browser to be on
the users/index again).

So far, so good. In production mode this would all work. But while
developing (and creating and running tests seems to be developing work
to me), I have values in my core.php file that make CakePHP to act
different than it would in production mode! To be specific: the debug
value in production mode is 0 which leads CakePHP to redirect the page
after displaying a flash message. But in development mode (values 1 to
3) this doesn't happen, and so one has to manually click the flash
link to get to the next page.

This seems very "unclean" to me. Web tests should be executed on the
live system, but when developing in CakePHP this doesn't really seem
possible: one would have to always change the values in core.php to
the ones used in the productive system, and then (to develop) back
again to the development system's ones.

IMHO there should be different configuration files for the different
environments, e.g. a core.development.php, a core.test.php and a
core.production.php file, and depending on whether I'm running a web
test or just looking at the website in a browser while developing, the
development or the test configuration file would be loaded.

In Ruby On Rails it's done exactly this way - even further: unlinke
CakePHP, RoR uses the test-database also for web tests ("integration"
tests called there).

All in all, CakePHP's paradigm of handling different environments
looks quite a bit unclear and intermingled to me...

Anyone has an opinion to this?

Thanks, 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