3 defined('AK_TEST_DATABASE_ON') ?
null : define('AK_TEST_DATABASE_ON', true);
4 require_once(dirname(__FILE__
).'/../../../fixtures/config/config.php');
6 class _AkActionController_model_instantiation
extends AkWebTestCase
10 $TestSetup = new AkUnitTest();
11 $TestSetup->installAndIncludeModels(array('Post','Comment','Tag'));
12 $Post =& $TestSetup->Post
->create(array('title'=>'One','body'=>'First post'));
13 foreach (range(1,5) as $n){
14 $Post->comment
->add(new Comment(array('body' => AkInflector
::ordinalize($n).' post')));
18 $Post->comment
->load();
19 $this->assertEqual($Post->comment
->count(), 5);
20 $this->post_id
= $Post->id
;
23 function test_should_access_public_action()
25 $this->setMaximumRedirects(0);
26 $this->get(AK_TESTING_URL
.'/post/comments/'.$this->post_id
);
27 $this->assertResponse(200);
28 $this->assertTextMatch('1st post2nd post3rd post4th post5th post');
32 ak_test('_AkActionController_model_instantiation', true);