Implemented the update-command in scripts/plugin. 'install' complains now about an...
[akelos.git] / test / unit / lib / AkActionController / _model_instantiation.php
blobb592ebfb8c55a745fa65f41165eea15a3f5a5a13
1 <?php
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
8 function test_setup()
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')));
16 $Post->save();
17 $Post->reload();
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);