This entry is the result of a forum thread. “The section Testing an HTTP GET on the Controller” doesn't work yet. It is on the front burner until the procedure and code does work. Watch the thread “functional tests (http://forum.akelos.org/discussion/123/)” for progress.
Definitions/variables:
——————————-
<?php require_once(dirname(__FILE__).'/../../fixtures/config/config.php'); require_once(AK_APP_DIR.DS.'application_controller.php'); require_once(AK_CONTROLLERS_DIR.DS.'name_controller.php'); class NameControllerTest extends AkWebTestCase { function test_Name() { $this->assertTrue(false, 'NameController has not been tested'); } } ak_test('NameControllerTest',true); ?>
To run the whole suite of tests in the above file, open a terminal window and enter:
cd root-folder/project
./script/test test/functional/controllers/name_controller.php
Add the following method to the above test:
function test_should_get_index() { $this->setMaximumRedirects(0); $this->get(AK_TESTING_URL.'/name/'); $this->assertResponse(200); }
This test is presently giving a response of 500 instead of the expected 200. This author, alake, doesn't know how to adjust this code for the desired result.