I am managed to do simple testing ( monkey singularization ).
http://wiki.cakephp.org/tutorials:testing_cake_apps
But how do I test controller?
This is my controller:
class HomeController extends AppController
{
var $helpers = array('Javascript');
var $components = array('Page');
var $uses = null;
function index()
{
$this->Page->setUpTemplate();
//index page specific
$this->set('workshop',
$this->Page->doc->page->language[$this->Page->lang_index]->workshop->CDATA());
.....
This is my home controller test:
class HomeTest extends UnitTestCase
{
function testindex()
{
$lang = $this->controller->Page->lang_index;
$this->assertEqual($lang, 1);
}
......
I want to test the lang variable.... but when I test it, $lang is null
which mean controller is not there.... Thank you.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---