Hello everybody.

I'm trying my first test suite with cake and I have downloaded the
testsuite from cakeforge (1.0.0.5) and using it on the 1.1.12.4205 version
of CakePHP.

I'm trying to understand how to create a SimpleTest, even following the
documentation in the app/vendors/simpletest/docs/ path.

I'm using this[1] code and get the error

Fatal error: Call to a member function on a non-object in
...app\controllers\posts_controller.php on line 6.

The method is missing is the set() method. The PostsController is a simple
controller I use for some testing, so the method is very simple[2].

Surely I'm missing something. Can please someone post an example 'cause
google cache is not worthwhile for the wiki and there's no more tutorial
on line.

Thanks
Davide

[1]<?php
/*
 * app/test/app/controllers/posts_controller.test.php
 */
require_once(APP . "/controllers/posts_controller.php");

class PostsControllerTest extends UnitTestCase{
   function testIndex(){
      $posts = new PostsController();

      print_r($posts);

      $posts->index();
   }
}
?>


[2]class PostsController extends AppController{
    var $name = 'Posts';

    function index(){
        $this->set('data',$this->Post->findAll());
    }
   ...
   }


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

Reply via email to