01.11 php saved
kabturek
Tags add more
1.2, cases and tests  
Note
the Category model test case
fixtures are here :
http://bin.cakephp.org/view/988525363
  1. <?php
  2. App::import('Model', 'Category');
  3. class CategoryTest extends Category{
  4.     var $cacheSources = false;
  5.     var $useDbConfig = 'test_suite';
  6. }
  7.  
  8. class CategoryTestCase extends CakeTestCase
  9. {
  10.  
  11.     var $fixtures = array('category');
  12.     function start() {
  13.     parent::start();
  14.     $this->Category = new CategoryTest();
  15.     }
  16.  
  17.     function testCount()
  18.     {
  19.     $result = $this->Category->findCount();
  20.     $expected = 6;
  21.     $this->assertEqual($result, $expected);
  22.     }
  23.  
  24. }
  25. ?>
Parsed in 0.022 seconds, using GeSHi 1.0.7.14

Modify this Paste