Changeset 772
- Timestamp:
- 09/22/08 10:09:12 (2 months ago)
- Location:
- trunk/app
- Files:
-
- 7 added
- 4 modified
-
models/news.php (modified) (3 diffs)
-
plugins/scorm/config/sql/scorm_postgresql.sql (added)
-
tests/cases/controllers/news_controller.test.php (modified) (3 diffs)
-
tests/cases/controllers/podcasts_controller.test.php (added)
-
tests/cases/controllers/quotes_controller.test.php (added)
-
tests/cases/models/vclassroom.test.php (added)
-
tests/cases/models/wiki.test.php (added)
-
tests/fixtures/message_test_fixture.php (added)
-
tests/fixtures/news_test_fixture.php (modified) (1 diff)
-
tests/fixtures/podcast_test_fixture.php (added)
-
views/acquaintances/display.ctp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/models/news.php
r701 r772 10 10 class News extends AppModel 11 11 { 12 public $name = 'News';12 public $name = 'News'; 13 13 14 public $belongsTo = array(14 public $belongsTo = array( 15 15 'User' => array( 16 16 'className' => 'User', … … 24 24 ); 25 25 26 public $hasMany = array(26 public $hasMany = array( 27 27 'Discussion' => array( 28 28 'className' => 'Discussion', … … 32 32 ); 33 33 34 public $validate = array(34 public $validate = array( 35 35 'title' => array( 36 36 'rule' => array('minLength', 4), -
trunk/app/tests/cases/controllers/news_controller.test.php
r771 r772 4 4 public function startCase() 5 5 { 6 echo '<h1>Starting Test Case</h1>';6 echo '<h1>Starting News Test Case</h1>'; 7 7 } 8 8 public function endCase() { 9 echo '<h1>Ending Test Case</h1>';9 echo '<h1>Ending News Test Case</h1>'; 10 10 } 11 public publicfunction startTest($method) {11 public function startTest($method) { 12 12 echo '<h3>Starting method ' . $method . '</h3>'; 13 13 } … … 15 15 echo '<hr />'; 16 16 } 17 public function testDisplay() { 18 $result = $this->testAction('/news/display'); 17 /* public function testDisplay() 18 { 19 $result = $this->testAction('/news/display', array('return'=>'render')); 19 20 debug($result); 20 } 21 } */ 21 22 public function testView() 22 23 { 23 24 $result = $this->testAction('/news/view/16', array('return'=>'render')); 24 debug($result); 25 // debug($result); 26 } 27 public function testDisplayNewIdGetRenderedHtml() 28 { 29 $result = $this->testAction('/news/display/16', array('return' => 'render')); 30 //debug(htmlentities($result)); 25 31 } 26 public function testDisplayGetRenderedHtml() {32 /* public function testDisplayGetRenderedHtml() { 27 33 $result = $this->testAction('/news/display/', array('return' => 'render')); 28 34 debug(htmlentities($result)); … … 32 38 array('return' => 'vars')); 33 39 debug($result); 34 } 35 public function testDiplayFixturized() { 36 $result = $this->testAction('/news/display/', 37 array('fixturize' => true)); 38 debug($result); 40 }*/ 41 public function testDisplayFixturized() { 42 $result = $this->testAction('/admin/news/add', array('fixturize' => true)); 43 debug($result); 39 44 } 40 45 public function testDisplayPostFixturized() 41 46 { 42 $data = array('News' => array('user_id' => 1, 'published' 43 => 1, 'slug'=>'new-article', 'title' => 'New Article', 'body' => 'New Body')); 44 $result = $this->testAction('/news/display', 45 array('fixturize' => true, 'data' => $data, 'method' => 'post')); 47 $data = array('News' => array('user_id' =>1, 'status'=>1, 'title' => 'New Article', 'body' => 'New Body')); 48 $result = $this->testAction('/admin/news/add', array('fixturize' => true, 'method' => 'post')); 46 49 debug($result); 47 50 } -
trunk/app/tests/fixtures/news_test_fixture.php
r771 r772 1 <?php 1 <?php 2 2 // News Model Unit Test 3 3 class NewsTestFixture extends CakeTestFixture { 4 4 5 5 public $name = 'NewsTest'; 6 public $import = array('model' => 'News', 'records' => true);6 //public $import = array('model' => 'News', 'records' => true, 'conection'=>'default'); 7 7 public $fields = array( 8 8 'id' => array('type' => 'integer', 'key' => 'primary'), 9 9 'title' => array('type'=>'string', 'length'=>50, 'null'=>false), 10 10 'body' => array('type'=>'text', 'null'=>false), 11 ' published'=> array('type' => 'integer', 'default' => 0, 'null' => false),11 'status' => array('type' => 'integer', 'default' => 0, 'null' => false), 12 12 'user_id' => array('type' => 'integer', 'default' => 1, 'null' => false), 13 13 'created' => 'timestamp', -
trunk/app/views/acquaintances/display.ctp
r541 r772 6 6 7 7 $tmp = '<h2>'. $val['Acquaintance']['name'] . '</h2>'; 8 $tmp .= para(null, $val['Acquaintance']['description']);9 $tmp .= para(null,$html->link($html->image('static/icon_http.gif', array("alt"=>"Go!", "alt"=>"Go!")),$val['Acquaintance']['url'], null, false, false));8 $tmp .= $html->para(null, $val['Acquaintance']['description']); 9 $tmp .= $html->para(null,$html->link($html->image('static/icon_http.gif', array("alt"=>"Go!", "alt"=>"Go!")),$val['Acquaintance']['url'], null, false, false)); 10 10 11 11 echo $html->div(null, $tmp, array('style'=>'padding:3px;border:1px dotted gray;margin:3px;'));
