Changeset 771 for trunk/app/tests
- Timestamp:
- 09/20/08 15:32:48 (2 months ago)
- Location:
- trunk/app/tests
- Files:
-
- 4 added
- 3 modified
-
cases/controllers/entries_controller.test.php (modified) (3 diffs)
-
cases/controllers/news_controller.test.php (added)
-
cases/models/entry.test.php (modified) (2 diffs)
-
cases/models/lesson.test.php (added)
-
fixtures/entry_test_fixture.php (modified) (2 diffs)
-
fixtures/lesson_test_fixture.php (added)
-
fixtures/news_test_fixture.php (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/tests/cases/controllers/entries_controller.test.php
r533 r771 1 1 <?php 2 // Chipotle Software 2002-2008 GPLv3 3 // MM 2 4 class EntriesControllerTest extends CakeTestCase { 5 3 6 public function startCase() 4 7 { … … 21 24 } 22 25 23 public function test Index()26 public function testDisplay() 24 27 { 25 $result = $this->testAction('/entries/ index');28 $result = $this->testAction('/entries/display'); 26 29 debug($result); 27 30 } … … 54 57 public function testIndexPostFixturized() 55 58 { 56 $data = array(' Article' => array('user_id' => 1, 'published'59 $data = array('Entry' => array('user_id' => 1, 'published' 57 60 => 1, 'slug'=>'new-article', 'title' => 'New Article', 'body' => 'New Body')); 58 61 $result = $this->testAction('/entries/index', -
trunk/app/tests/cases/models/entry.test.php
r533 r771 1 1 <?php 2 App::import('Model','Entry'); 2 // Chipotle Software 2002-2008 GLv3 3 4 App::import('Model','Entry'); 3 5 4 6 class EntryTest extends Entry { 5 public $name = 'EntryTest';6 public $useDbConfig = 'test_suit e';7 public $name = 'EntryTest'; 8 public $useDbConfig = 'test_suit'; 7 9 } 8 10 9 11 class EntryTestCase extends CakeTestCase { 10 public $fixtures = array('entry_test' );11 12 12 public function testPublished() 13 public $fixtures = array('app.entry_test'); 14 /* 15 public function testGetComments() 13 16 { 14 17 $this->EntryTest =& new EntryTest(); 15 18 16 $result = $this->EntryTest->published(array('id', 'title')); 19 $result = $this->EntryTest->getComments(2); 20 17 21 $expected = array( 18 22 array('EntryTest' => array( 'id' => 1, 'title' => 'First Entry' )), … … 22 26 23 27 $this->assertEqual($result, $expected); 24 } 28 }*/ 25 29 } 26 30 ?> -
trunk/app/tests/fixtures/entry_test_fixture.php
r533 r771 1 1 <?php 2 // Entry Model Unit Test 2 3 class EntryTestFixture extends CakeTestFixture { 3 4 … … 5 6 public $import = array('model' => 'Entry', 'records' => true); 6 7 public $fields = array( 7 'id' => array('type' => 'integer', 'key' => 'primary'), 8 'title' => array('type' => 'string', 'length' => 255, 'null' => false), 9 'body' => 'text', 10 'published' => array('type' => 'integer', 'default' => '0', 'null' => false), 11 'created' => 'datetime', 12 'updated' => 'datetime' 13 ); 14 public $records = array( 15 array ('id' => 1, 'title' => 'First Entry', 'body' => 'First Entry Body', 'published' => '1', 'created' => '2007-03-18 10:39:23', 'updated' => '2007-03-18 10:41:31'), 16 array ('id' => 2, 'title' => 'Second Entry', 'body' => 'Second Entry Body', 'published' => '1', 'created' => '2007-03-18 10:41:23', 'updated' => '2007-03-18 10:43:31'), 17 array ('id' => 3, 'title' => 'Third Entry', 'body' => 'Third Entry Body', 'published' => '1', 'created' => '2007-03-18 10:43:23', 'updated' => '2007-03-18 10:45:31') 8 'id' => array('type' => 'integer', 'key' => 'primary'), 9 'title' => array('type'=>'string', 'length'=>50, 'null'=>false), 10 'body' => array('type'=>'text', 'null'=>false), 11 'published' => array('type' => 'integer', 'default' => 0, 'null' => false), 12 'user_id' => array('type' => 'integer', 'default' => 1, 'null' => false), 13 'created' => 'timestamp', 14 'updated' => 'timestamp' 15 ); 16 public $records = array( 17 array('id'=>1, 'title' => 'First Entry', 'body' => 'First Entry Body', 'published'=>1, 'user_id'=>1, 'created' => '2007-03-18 10:39:23', 'updated' => '2007-03-18 10:41:31'), 18 array('id'=>2, 'title' => 'Second Entry', 'body' => 'Second Entry Body', 'published' => 1, 'user_id'=>1, 'created' => '2007-03-18 10:41:23', 'updated' => '2007-03-18 10:43:31'), 19 array('id'=>3, 'title'=>'Third Entry', 'body' => 'Third Entry Body', 'published' => 1, 'user_id'=>1, 'created' => '2007-03-18 10:43:23', 'updated' => '2007-03-18 10:45:31') 18 20 ); 19 21 }
