I'm sure it's late, but just in case anybody google this.
When using the loadController(), just pass the Conroller name without
'Controller''. Cake will concatenate it later.
in your example:
loadController ('Posts');
On 7 sep, 18:38, dresdn <[EMAIL PROTECTED]> wrote:
> Hi.
>
> I just started looking at CakePHP just over a week ago, and so far, I
> like what I see. Based on documentation, etc., I've decided to start
> out with the 1.2 branch due to all the nice new features.
>
> One of the things I was most interested in was testing, and using the
> Blog Tutorial as a starting point, I wanted to write some tests. I
> did
> findhttp://bakery.cakephp.org/articles/view/testing-models-with-cakephp-1...
> , but for some reason I'm not able to do the same for the controller.
>
> What I have so far in tests/cases/controller/post_controller.test.php
> is:
>
> <?php
> loadController ('PostsController');
>
> class PostsTest extends PostsController {
> var $name = 'PostsTest';
>
> }
>
> class PostsControllerTest extends CakeTestCase {
> var $fixtures = array ('post_test');
>
> function testIndex () {
> $this->get ('/posts');
> $this->assertResponse (SUCCESS);
> }
>
> }
>
> When I run the test, I get a Fatal error: Class 'PostsController' not
> found in
>
> It looks like loadController() isn't doing anything. Am I way off on
> this? I'm running from svn rev. 5619.
>
> Any help would be appreciated!
>
> Thanks in advance,
> Mike
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---