Changeset 4773
- Timestamp:
- 08/15/08 13:52:09 (19 months ago)
- Location:
- branches/1.0/tests
- Files:
-
- 3 modified
-
DoctrineTest.php (modified) (6 diffs)
-
run.php (modified) (1 diff)
-
Ticket/NjeroTestCase.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.0/tests/DoctrineTest.php
r4149 r4773 171 171 { 172 172 $models = new DirectoryIterator(dirname(__FILE__) . '/models/'); 173 173 174 foreach($models as $key => $file) { 174 175 if ($file->isFile() && ! $file->isDot()) { 175 176 $e = explode('.', $file->getFileName()); 177 176 178 if (end($e) === 'php') { 177 179 require_once $file->getPathname(); … … 190 192 $currentName=''; 191 193 $options=array(); 194 192 195 foreach($array as $name) { 193 196 if (strpos($name,'-')===0) { 194 $name=str_replace('-','',$name); 197 $name=str_replace('-','',$name); 195 198 $currentName=$name; 199 196 200 if ( ! isset($options[$currentName])) { 197 201 $options[$currentName]=array(); … … 203 207 } 204 208 } 209 205 210 return $options; 206 211 } … … 219 224 } 220 225 221 $e = explode('_', $class); 222 $count = count($e); 223 226 $e = explode('_', $class); 227 $count = count($e); 224 228 $prefix = array_shift($e); 225 229 … … 228 232 } 229 233 230 $dir = array_shift($e); 231 232 $file = $dir . '_' . substr(implode('_', $e), 0, -(strlen('_TestCase'))) . 'TestCase.php'; 233 234 if ( $count > 3) { 235 $file = str_replace('_', DIRECTORY_SEPARATOR, $file); 236 } else { 237 $file = str_replace('_', '', $file); 238 } 234 $dir = array_shift($e); 235 $file = $dir . '_' . substr(implode('_', $e), 0, -(strlen('_TestCase'))) . 'TestCase.php'; 236 $file = str_replace('_', (($count > 3) ? DIRECTORY_SEPARATOR : ''), $file); 239 237 240 238 // create a test case file if it doesn't exist 241 242 239 if ( ! file_exists($file)) { 243 240 $contents = file_get_contents('template.tpl'); … … 250 247 file_put_contents($file, $contents); 251 248 } 249 252 250 require_once($file); 253 251 -
branches/1.0/tests/run.php
r4772 r4773 1 1 <?php 2 3 // Debug Diagnosic process attacher sleep time needed to link process 4 // More info about that: http://bugs.php.net/bugs-generating-backtrace-win32.php 5 //sleep(10); 6 2 7 error_reporting(E_ALL | E_STRICT); 3 8 ini_set('max_execution_time', 900); 4 9 ini_set('date.timezone', 'GMT+0'); 5 10 11 $DCTRN_DIR = (defined('DOCTRINE_DIR') ? DOCTRINE_DIR : dirname(__FILE__) . '/../lib/'); 12 6 13 require_once(dirname(__FILE__) . '/DoctrineTest.php'); 7 require_once( (defined('DOCTRINE_DIR') ? DOCTRINE_DIR : dirname(__FILE__) . '/../lib/').'Doctrine.php');14 require_once($DCTRN_DIR .'Doctrine.php'); 8 15 spl_autoload_register(array('Doctrine', 'autoload')); 9 16 spl_autoload_register(array('DoctrineTest','autoload')); 17 18 /*require_once $DCTRN_DIR . 'Doctrine/Exception.php'; 19 20 require_once $DCTRN_DIR . 'Doctrine/Locator/Injectable.php'; 21 require_once $DCTRN_DIR . 'Doctrine/Access.php'; 22 require_once $DCTRN_DIR . 'Doctrine/Record/Abstract.php'; 23 require_once $DCTRN_DIR . 'Doctrine/Record.php'; 24 25 require_once $DCTRN_DIR . 'Doctrine/Configurable.php'; 26 require_once $DCTRN_DIR . 'Doctrine/Table.php'; 27 28 require_once $DCTRN_DIR . 'Doctrine/EventListener/Interface.php'; 29 require_once $DCTRN_DIR . 'Doctrine/EventListener.php'; 30 31 require_once $DCTRN_DIR . 'Doctrine/Template.php'; 32 33 require_once $DCTRN_DIR . 'Doctrine/Manager/Exception.php'; 34 require_once $DCTRN_DIR . 'Doctrine/Manager.php'; 35 require_once $DCTRN_DIR . 'Doctrine/Null.php'; 36 */ 37 // Test case 38 //require_once dirname(__FILE__) . '/Ticket/NjeroTestCase.php'; 39 10 40 11 41 $test = new DoctrineTest(); -
branches/1.0/tests/Ticket/NjeroTestCase.php
r3884 r4773 15 15 { 16 16 public function prepareData() { } 17 17 18 public function prepareTables() 18 19 { … … 22 23 $this->tables[] = 'PolicyN'; 23 24 $this->tables[] = 'RateN'; 24 parent::prepareTables(); 25 26 parent::prepareTables(); 25 27 } 26 28