06.03 php saved
woodz
Tags add more
model import, tests and unit testing  
Note
woodz did not leave a note
  1. <?php
  2.  
  3. App::import('Model', 'User');
  4.  
  5. /**
  6. * Subclass of my model.
  7. */
  8. class UserTest extends User
  9. {
  10.      var $useTable='users';
  11.     //tried a few variations here!
  12.     //var $useDbConfig = 'test_suite'; 
  13.     //var $name = 'UserTest';
  14.     //var $useDbConfig = 'default';
  15.     //var $tablePrefix = '';
  16. }
  17.  
  18.  
  19.  
  20. class UserTestCase extends CakeTestCase
  21. {
  22.     var $TestUser = null;
  23.     var $fixtures = array( 'user_confirmation_test' );
  24.    
  25.  
  26.     function tearDown() {
  27.         //unset($this->TestUser);
  28.     }
  29.  
  30.  
  31.     function startCase()   
  32.     {
  33.         echo "start case got run";   
  34.         $this->TestUser = new UserTest();
  35.         exit;
  36.     }
  37.    
  38.     function startTest()
  39.     {
  40.         echo "start test got run";
  41.         exit;
  42.        
  43.     }
  44.     /**
  45.      *
  46.      * @return
  47.      */
  48.     function testConfirmEmail()
  49.     {
  50.        
  51.     // do stuff!
  52.     }
  53.    
  54. }
  55. ?>
Parsed in 0.039 seconds, using GeSHi 1.0.7.14

Modify this Paste