- Timestamp:
- Dec 6, 2013 7:17:37 PM (10 years ago)
- Location:
- branches/eli_branch
- Files:
-
- 4 added
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eli_branch/lib/App.inc.php
r439 r442 30 30 */ 31 31 32 //ob_start(); 33 32 34 // Message Types. 33 35 define('MSG_ERR', 1); … … 244 246 245 247 // Error reporting. 248 /* 246 249 ini_set('error_reporting', $this->getParam('error_reporting')); 247 250 ini_set('display_errors', $this->getParam('display_errors')); … … 250 253 ini_set('error_log', $this->getParam('log_directory') . '/' . $this->getParam('php_error_log')); 251 254 } 252 255 */ 253 256 // Set character set to use for multi-byte string functions. 254 257 mb_internal_encoding($this->getParam('character_set')); … … 273 276 274 277 if (true === $this->getParam('enable_db')) { 275 278 276 279 // DB connection parameters taken from environment variables in the httpd.conf file, readable only by root. 277 280 if (!empty($_SERVER['DB_SERVER'])) { … … 319 322 320 323 // Session parameters. 324 /* 321 325 ini_set('session.gc_probability', 1); 322 326 ini_set('session.gc_divisor', 1000); … … 327 331 ini_set('session.entropy_length', '512'); 328 332 ini_set('session.cookie_httponly', true); 333 * */ 329 334 session_name($this->getParam('session_name')); 330 335 … … 339 344 340 345 // Start the session. 341 session_start();346 //session_start(); 342 347 343 348 if (!isset($_SESSION['_app'][$this->_ns])) { … … 374 379 375 380 // Character set. This should also be printed in the html header template. 376 header('Content-type: text/html; charset=' . $this->getParam('character_set'));381 //header('Content-type: text/html; charset=' . $this->getParam('character_set')); 377 382 378 383 // Set the version of the codebase we're using. … … 381 386 $codebase_version = trim(file_get_contents($codebase_version_file)); 382 387 $this->setParam(array('codebase_version' => $codebase_version)); 383 header('X-Codebase-Version: ' . $codebase_version);388 //header('X-Codebase-Version: ' . $codebase_version); 384 389 } 385 390 … … 397 402 { 398 403 session_write_close(); 399 restore_include_path();400 404 $this->running = false; 401 405 $num_queries = 0; … … 449 453 ); 450 454 } 451 455 452 456 if (!in_array($type, array(MSG_NOTICE, MSG_SUCCESS, MSG_WARNING, MSG_ERR))) { 453 457 $this->logMsg(sprintf('Invalid MSG_* type: %s', $type), LOG_NOTICE, __FILE__, __LINE__); … … 469 473 return false; 470 474 } 471 475 //die($_SESSION['_app'][$this->_ns]['messages']); 472 476 return isset($_SESSION['_app'][$this->_ns]['messages']) ? $_SESSION['_app'][$this->_ns]['messages'] : array(); 473 477 } … … 503 507 public function printRaisedMessages($above='', $below='', $print_gotohash_js=false, $hash='sc-msg') 504 508 { 509 505 510 if (!$this->running) { 506 511 $this->logMsg(sprintf('Canceled method call %s, application not running.', __FUNCTION__), LOG_NOTICE, __FILE__, __LINE__); -
branches/eli_branch/lib/Lock.inc.php
r439 r442 350 350 * Deletes all locks that are older than auto_timeout. 351 351 */ 352 p rivatefunction _auto_timeout()352 public function _auto_timeout() 353 353 { 354 354 $db =& DB::getInstance(); -
branches/eli_branch/tests/AppTest.php
r438 r442 30 30 * Created with PHPUnit_Skeleton on 2005-08-09 31 31 */ 32 require_once 'PHPUnit.php'; 33 class AppTest extends PHPUnit_TestCase { 32 // 33 34 class AppTest extends PHPUnit_Framework_TestCase { 34 35 35 36 var $App; 36 37 function AppTest($name) 38 { 39 $this->PHPUnit_TestCase($name); 40 } 37 38 static $shared_session; 41 39 42 40 function setUp() … … 44 42 require dirname(__FILE__) . '/_config.inc.php'; 45 43 $this->App =& $app; 44 $_SESSION = AppTest::$shared_session; 46 45 } 47 46 … … 49 48 { 50 49 unset($this->App); 50 AppTest::$shared_session = $_SESSION; 51 51 } 52 52 … … 62 62 'test_config_value' => 1234 63 63 )); 64 $this->assertTrue(1234 === $this->App-> _params['test_config_value']);64 $this->assertTrue(1234 === $this->App->getParam('test_config_value')); 65 65 } 66 66 67 67 function test_getParam() 68 68 { 69 $this->App->_params['test_config_value2'] = 'okay'; 69 //$this->App->setParam('test_config_value2', 'okay'); 70 $this->App->setParam(array( 71 'test_config_value2' => 'okay' 72 )); 70 73 $result = $this->App->getParam('test_config_value2'); 71 74 $this->assertEquals('okay', $result); … … 104 107 $expected = 'My message'; 105 108 $app->raiseMsg($expected, MSG_NOTICE, __FILE__, __LINE__); 106 $msg = current($_SESSION['_app'][ $this->App->_ns]['messages']);109 $msg = current($_SESSION['_app']['testapp']['messages']); 107 110 $this->assertEquals($expected, $msg['message']); 108 111 } … … 111 114 { 112 115 ob_start(); 116 //$this->test_raisemsg(); //had to add this line for phpunit ver. 3.7 113 117 $app =& App::getInstance(); 114 118 $app->printraisedmessages(); … … 205 209 } 206 210 // Running the test. 211 /* 207 212 $suite = new PHPUnit_TestSuite('AppTest'); 208 213 $result = PHPUnit::run($suite); 209 214 echo $result->toString(); 215 */ -
branches/eli_branch/tests/AuthorizeNetTest.php
r438 r442 30 30 * Created with PHPUnit_Skeleton on 2005-08-09 31 31 */ 32 require_once 'PHPUnit.php'; 33 class AuthorizeNetTest extends PHPUnit_ TestCase {32 33 class AuthorizeNetTest extends PHPUnit_Framework_TestCase { 34 34 35 35 var $AuthorizeNet; 36 37 function AuthorizeNetTest($name) 38 { 39 $this->PHPUnit_TestCase($name); 40 } 41 36 37 static $shared_session; 38 42 39 function setUp() 43 40 { … … 45 42 require_once '../lib/AuthorizeNet.inc.php'; 46 43 47 $this->AuthorizeNet = &new AuthorizeNet();44 $this->AuthorizeNet = new AuthorizeNet(); 48 45 $this->AuthorizeNet->setParam(array( 49 46 'x_login' => 'myaccount', … … 61 58 'x_zip' => '75010', 62 59 )); 60 $_SESSION = AuthorizeNetTest::$shared_session; 63 61 } 64 62 … … 66 64 { 67 65 unset($this->AuthorizeNet); 66 AuthorizeNetTest::$shared_session = $_SESSION; 68 67 } 69 68 … … 71 70 { 72 71 $this->AuthorizeNet->setparam(array('x_Login' => 'myaccount2')); 73 $this->assertEquals('myaccount2', $this->AuthorizeNet-> _params['x_Login']);72 $this->assertEquals('myaccount2', $this->AuthorizeNet->getParam('x_Login')); 74 73 } 75 74 … … 119 118 120 119 } 121 // Running the test.122 $suite = new PHPUnit_TestSuite('AuthorizeNetTest');123 $result = PHPUnit::run($suite);124 echo $result->toString(); -
branches/eli_branch/tests/CSSTest.php
r438 r442 30 30 * Created with PHPUnit_Skeleton on 2005-08-09 31 31 */ 32 require_once 'PHPUnit.php'; 33 class CSSTest extends PHPUnit_ TestCase {32 33 class CSSTest extends PHPUnit_Framework_TestCase { 34 34 35 35 var $CSS; 36 36 var $test_css_file; 37 38 function CSSTest($name)39 {40 $this->PHPUnit_TestCase($name);41 }42 37 43 38 function setUp() … … 46 41 $this->test_css_file = dirname(__FILE__) . '/../css/codebase.inc.css'; 47 42 require_once '../lib/CSS.inc.php'; 48 $this->CSS = &new CSS();43 $this->CSS = new CSS(); 49 44 $this->CSS->setFile($this->test_css_file); 50 45 } … … 86 81 87 82 } 88 // Running the test.89 $suite = new PHPUnit_TestSuite('CSSTest');90 $result = PHPUnit::run($suite);91 echo $result->toString(); -
branches/eli_branch/tests/CacheTest.php
r438 r442 33 33 * Created with PHPUnit_Skeleton on 2005-08-09 34 34 */ 35 require_once 'PHPUnit.php'; 36 class CacheTest extends PHPUnit_ TestCase {35 36 class CacheTest extends PHPUnit_Framework_TestCase { 37 37 38 38 var $Cache; … … 40 40 function CacheTest($name) 41 41 { 42 $this->PHPUnit_ TestCase($name);42 $this->PHPUnit_Framework_TestCase($name); 43 43 } 44 44 … … 105 105 106 106 } 107 // Running the test.108 $suite = new PHPUnit_TestSuite('CacheTest');109 $result = PHPUnit::run($suite);110 echo $result->toString(); -
branches/eli_branch/tests/DBSessionHandlerTest.php
r438 r442 30 30 * Created with PHPUnit_Skeleton on 2005-08-09 31 31 */ 32 require_once 'PHPUnit.php'; 33 class DBSessionHandlerTest extends PHPUnit_ TestCase {32 33 class DBSessionHandlerTest extends PHPUnit_Framework_TestCase { 34 34 35 35 var $DBSessionHandler; 36 37 function DBSessionHandlerTest($name)38 {39 $this->PHPUnit_TestCase($name);40 }41 36 42 37 function setUp() … … 87 82 88 83 } 89 // Running the test.90 $suite = new PHPUnit_TestSuite('DBSessionHandlerTest');91 $result = PHPUnit::run($suite);92 echo $result->toString(); -
branches/eli_branch/tests/EmailTest.php
r438 r442 1 1 <?php 2 2 3 /** 3 4 * The Strangecode Codebase - a general application development framework for PHP … … 30 31 * Created with PHPUnit_Skeleton on 2005-12-01 31 32 */ 32 require_once 'PHPUnit.php'; 33 class EmailTest extends PHPUnit_ TestCase {33 34 class EmailTest extends PHPUnit_Framework_TestCase { 34 35 35 36 var $Email; 36 37 function EmailTest($name)38 {39 $this->PHPUnit_TestCase($name);40 }41 37 42 38 function setUp() … … 44 40 require dirname(__FILE__) . '/_config.inc.php'; 45 41 require_once '../lib/Email.inc.php'; 46 $this->Email = &new Email();42 $this->Email = new Email(); 47 43 } 48 44 … … 122 118 123 119 } 124 // Running the test.125 $suite = new PHPUnit_TestSuite('EmailTest');126 $result = PHPUnit::run($suite);127 echo $result->toString(); -
branches/eli_branch/tests/FormValidatorTest.php
r438 r442 30 30 * Created with PHPUnit_Skeleton on 2005-08-09 31 31 */ 32 require_once 'PHPUnit.php'; 33 class FormValidatorTest extends PHPUnit_ TestCase {32 33 class FormValidatorTest extends PHPUnit_Framework_TestCase { 34 34 35 35 var $FormValidator; 36 37 function FormValidatorTest($name)38 {39 $this->PHPUnit_TestCase($name);40 }41 36 42 37 function setUp() … … 44 39 require dirname(__FILE__) . '/_config.inc.php'; 45 40 require_once '../lib/FormValidator.inc.php'; 46 $this->FormValidator = &new FormValidator();41 $this->FormValidator = new FormValidator(); 47 42 } 48 43 … … 294 289 295 290 } 296 // Running the test.297 $suite = new PHPUnit_TestSuite('FormValidatorTest');298 $result = PHPUnit::run($suite);299 echo $result->toString(); -
branches/eli_branch/tests/Google_APITest.php
r438 r442 33 33 * Created with PHPUnit_Skeleton on 2005-08-09 34 34 */ 35 require_once 'PHPUnit.php'; 36 class GoogleAPITest extends PHPUnit_ TestCase {35 36 class GoogleAPITest extends PHPUnit_Framework_TestCase { 37 37 38 38 var $GoogleAPI; … … 40 40 function GoogleAPITest($name) 41 41 { 42 $this->PHPUnit_ TestCase($name);42 $this->PHPUnit_Framework_TestCase($name); 43 43 } 44 44 … … 91 91 92 92 } 93 // Running the test.94 $suite = new PHPUnit_TestSuite('GoogleAPITest');95 $result = PHPUnit::run($suite);96 echo $result->toString(); -
branches/eli_branch/tests/HierarchyTest.php
r438 r442 33 33 * Created with PHPUnit_Skeleton on 2005-08-09 34 34 */ 35 require_once 'PHPUnit.php'; 36 class HierarchyTest extends PHPUnit_ TestCase {35 36 class HierarchyTest extends PHPUnit_Framework_TestCase { 37 37 38 38 var $Hierarchy; … … 40 40 function HierarchyTest($name) 41 41 { 42 $this->PHPUnit_ TestCase($name);42 $this->PHPUnit_Framework_TestCase($name); 43 43 } 44 44 … … 175 175 176 176 } 177 // Running the test.178 $suite = new PHPUnit_TestSuite('HierarchyTest');179 $result = PHPUnit::run($suite);180 echo $result->toString(); -
branches/eli_branch/tests/ImageThumbTest.php
r438 r442 33 33 * Created with PHPUnit_Skeleton on 2005-08-09 34 34 */ 35 require_once 'PHPUnit.php'; 36 class ImageThumbTest extends PHPUnit_ TestCase {35 36 class ImageThumbTest extends PHPUnit_Framework_TestCase { 37 37 38 38 var $ImageThumb; … … 40 40 function ImageThumbTest($name) 41 41 { 42 $this->PHPUnit_ TestCase($name);42 $this->PHPUnit_Framework_TestCase($name); 43 43 } 44 44 … … 119 119 120 120 } 121 // Running the test.122 $suite = new PHPUnit_TestSuite('ImageThumbTest');123 $result = PHPUnit::run($suite);124 echo $result->toString(); -
branches/eli_branch/tests/LockTest.php
r438 r442 30 30 * Created with PHPUnit_Skeleton on 2005-08-09 31 31 */ 32 require_once 'PHPUnit.php'; 33 class LockTest extends PHPUnit_ TestCase {32 33 class LockTest extends PHPUnit_Framework_TestCase { 34 34 35 35 var $Lock; 36 36 var $Auth_SQL; 37 38 function LockTest($name)39 {40 $this->PHPUnit_TestCase($name);41 }42 37 43 38 function setUp() … … 47 42 require_once '../lib/Auth_SQL.inc.php'; 48 43 49 $this->Auth_SQL = &new Auth_SQL('test');44 $this->Auth_SQL = new Auth_SQL('test'); 50 45 $this->Auth_SQL->setParam(array( 51 46 'db_table' => 'test_user_tbl', … … 208 203 { 209 204 $result = $this->Lock->getsecondselapsed(); 210 $this->assert Type('integer', $result);205 $this->assertInternalType('integer', $result); 211 206 } 212 207 213 208 } 214 // Running the test.215 $suite = new PHPUnit_TestSuite('LockTest');216 $result = PHPUnit::run($suite);217 echo $result->toString(); -
branches/eli_branch/tests/MCVETest.php
r438 r442 33 33 * Created with PHPUnit_Skeleton on 2005-08-09 34 34 */ 35 require_once 'PHPUnit.php'; 36 class MCVETest extends PHPUnit_ TestCase {35 36 class MCVETest extends PHPUnit_Framework_TestCase { 37 37 38 38 var $MCVE; … … 40 40 function MCVETest($name) 41 41 { 42 $this->PHPUnit_ TestCase($name);42 $this->PHPUnit_Framework_TestCase($name); 43 43 } 44 44 … … 91 91 92 92 } 93 // Running the test.94 $suite = new PHPUnit_TestSuite('MCVETest');95 $result = PHPUnit::run($suite);96 echo $result->toString(); -
branches/eli_branch/tests/NavTest.php
r438 r442 33 33 * Created with PHPUnit_Skeleton on 2005-08-09 34 34 */ 35 require_once 'PHPUnit.php'; 36 class NavigationTest extends PHPUnit_ TestCase {35 36 class NavigationTest extends PHPUnit_Framework_TestCase { 37 37 38 38 var $Navigation; … … 40 40 function NavigationTest($name) 41 41 { 42 $this->PHPUnit_ TestCase($name);42 $this->PHPUnit_Framework_TestCase($name); 43 43 } 44 44 … … 133 133 134 134 } 135 // Running the test.136 $suite = new PHPUnit_TestSuite('NavigationTest');137 $result = PHPUnit::run($suite);138 echo $result->toString(); -
branches/eli_branch/tests/PEditTest.php
r438 r442 33 33 * Created with PHPUnit_Skeleton on 2005-08-09 34 34 */ 35 require_once 'PHPUnit.php'; 36 class PEditTest extends PHPUnit_ TestCase {35 36 class PEditTest extends PHPUnit_Framework_TestCase { 37 37 38 38 var $PEdit; … … 40 40 function PEditTest($name) 41 41 { 42 $this->PHPUnit_ TestCase($name);42 $this->PHPUnit_Framework_TestCase($name); 43 43 } 44 44 … … 154 154 155 155 } 156 // Running the test.157 $suite = new PHPUnit_TestSuite('PEditTest');158 $result = PHPUnit::run($suite);159 echo $result->toString(); -
branches/eli_branch/tests/PageNumbersTest.php
r438 r442 33 33 * Created with PHPUnit_Skeleton on 2005-08-09 34 34 */ 35 require_once 'PHPUnit.php'; 36 class PageNumbersTest extends PHPUnit_ TestCase {35 36 class PageNumbersTest extends PHPUnit_Framework_TestCase { 37 37 38 38 var $PageNumbers; … … 40 40 function PageNumbersTest($name) 41 41 { 42 $this->PHPUnit_ TestCase($name);42 $this->PHPUnit_Framework_TestCase($name); 43 43 } 44 44 … … 133 133 134 134 } 135 // Running the test.136 $suite = new PHPUnit_TestSuite('PageNumbersTest');137 $result = PHPUnit::run($suite);138 echo $result->toString(); -
branches/eli_branch/tests/PageSequenceTest.php
r438 r442 33 33 * Created with PHPUnit_Skeleton on 2005-08-09 34 34 */ 35 require_once 'PHPUnit.php'; 36 class PageSequenceTest extends PHPUnit_ TestCase {35 36 class PageSequenceTest extends PHPUnit_Framework_TestCase { 37 37 38 38 var $PageSequence; … … 40 40 function PageSequenceTest($name) 41 41 { 42 $this->PHPUnit_ TestCase($name);42 $this->PHPUnit_Framework_TestCase($name); 43 43 } 44 44 … … 182 182 183 183 } 184 // Running the test.185 $suite = new PHPUnit_TestSuite('PageSequenceTest');186 $result = PHPUnit::run($suite);187 echo $result->toString(); -
branches/eli_branch/tests/PayPalTest.php
r438 r442 30 30 * Created with PHPUnit_Skeleton on 2005-08-09 31 31 */ 32 require_once 'PHPUnit.php'; 33 class PayPalTest extends PHPUnit_ TestCase {32 33 class PayPalTest extends PHPUnit_Framework_TestCase { 34 34 35 35 var $PayPal; 36 37 function PayPalTest($name)38 {39 $this->PHPUnit_TestCase($name);40 }41 36 42 37 function setUp() … … 44 39 require dirname(__FILE__) . '/_config.inc.php'; 45 40 require_once '../lib/PayPal.inc.php'; 46 $this->PayPal = &new PayPal();41 $this->PayPal = new PayPal(); 47 42 48 43 // Defaults for purchasing classified postings. … … 90 85 )); 91 86 $result = $this->PayPal->getlink('testitem'); 92 $this->assertTrue(preg_match('/customdata/', $result)); 87 //$this->assertTrue(preg_match('/customdata/', $result)); 88 $this->assertSame(1, preg_match('/customdata/', $result)); 93 89 } 94 90 … … 103 99 $this->PayPal->printbutton('testitem'); 104 100 $result = ob_get_clean(); 105 $this->assertTrue(preg_match('/customdata/', $result)); 101 //$this->assertTrue(preg_match('/customdata/', $result)); 102 $this->assertSame(1, preg_match('/customdata/', $result)); 103 106 104 } 107 105 … … 134 132 135 133 } 136 // Running the test.137 $suite = new PHPUnit_TestSuite('PayPalTest');138 $result = PHPUnit::run($suite);139 echo $result->toString(); -
branches/eli_branch/tests/PrefsTest.php
r438 r442 33 33 * Created with PHPUnit_Skeleton on 2005-08-09 34 34 */ 35 require_once 'PHPUnit.php'; 36 class PrefsTest extends PHPUnit_ TestCase {35 36 class PrefsTest extends PHPUnit_Framework_TestCase { 37 37 38 38 var $Prefs; … … 40 40 function PrefsTest($name) 41 41 { 42 $this->PHPUnit_ TestCase($name);42 $this->PHPUnit_Framework_TestCase($name); 43 43 } 44 44 … … 112 112 113 113 } 114 // Running the test.115 $suite = new PHPUnit_TestSuite('PrefsTest');116 $result = PHPUnit::run($suite);117 echo $result->toString(); -
branches/eli_branch/tests/ScriptTimerTest.php
r438 r442 33 33 * Created with PHPUnit_Skeleton on 2005-08-09 34 34 */ 35 require_once 'PHPUnit.php'; 36 class ScriptTimerTest extends PHPUnit_ TestCase {35 36 class ScriptTimerTest extends PHPUnit_Framework_TestCase { 37 37 38 38 var $ScriptTimer; … … 40 40 function ScriptTimerTest($name) 41 41 { 42 $this->PHPUnit_ TestCase($name);42 $this->PHPUnit_Framework_TestCase($name); 43 43 } 44 44 … … 77 77 78 78 } 79 // Running the test.80 $suite = new PHPUnit_TestSuite('ScriptTimerTest');81 $result = PHPUnit::run($suite);82 echo $result->toString(); -
branches/eli_branch/tests/SortOrderTest.php
r438 r442 33 33 * Created with PHPUnit_Skeleton on 2005-08-09 34 34 */ 35 require_once 'PHPUnit.php'; 36 class SortOrderTest extends PHPUnit_ TestCase {35 36 class SortOrderTest extends PHPUnit_Framework_TestCase { 37 37 38 38 var $SortOrder; … … 40 40 function SortOrderTest($name) 41 41 { 42 $this->PHPUnit_ TestCase($name);42 $this->PHPUnit_Framework_TestCase($name); 43 43 } 44 44 … … 91 91 92 92 } 93 // Running the test.94 $suite = new PHPUnit_TestSuite('SortOrderTest');95 $result = PHPUnit::run($suite);96 echo $result->toString(); -
branches/eli_branch/tests/SpellCheckTest.php
r438 r442 33 33 * Created with PHPUnit_Skeleton on 2005-08-09 34 34 */ 35 require_once 'PHPUnit.php'; 36 class SpellCheckTest extends PHPUnit_ TestCase {35 36 class SpellCheckTest extends PHPUnit_Framework_TestCase { 37 37 38 38 var $SpellCheck; … … 40 40 function SpellCheckTest($name) 41 41 { 42 $this->PHPUnit_ TestCase($name);42 $this->PHPUnit_Framework_TestCase($name); 43 43 } 44 44 … … 154 154 155 155 } 156 // Running the test.157 $suite = new PHPUnit_TestSuite('SpellCheckTest');158 $result = PHPUnit::run($suite);159 echo $result->toString(); -
branches/eli_branch/tests/TemplateGlueTest.php
r438 r442 33 33 * Created with PHPUnit_Skeleton on 2005-08-09 34 34 */ 35 require_once 'PHPUnit.php'; 36 class TemplateGlueTest extends PHPUnit_ TestCase {35 36 class TemplateGlueTest extends PHPUnit_Framework_TestCase { 37 37 38 38 var $TemplateGlue; … … 40 40 function TemplateGlueTest($name) 41 41 { 42 $this->PHPUnit_ TestCase($name);42 $this->PHPUnit_Framework_TestCase($name); 43 43 } 44 44 … … 56 56 57 57 } 58 // Running the test.59 $suite = new PHPUnit_TestSuite('TemplateGlueTest');60 $result = PHPUnit::run($suite);61 echo $result->toString(); -
branches/eli_branch/tests/UploadTest.php
r438 r442 33 33 * Created with PHPUnit_Skeleton on 2005-08-09 34 34 */ 35 require_once 'PHPUnit.php'; 36 class UploadTest extends PHPUnit_ TestCase {35 36 class UploadTest extends PHPUnit_Framework_TestCase { 37 37 38 38 var $Upload; … … 40 40 function UploadTest($name) 41 41 { 42 $this->PHPUnit_ TestCase($name);42 $this->PHPUnit_Framework_TestCase($name); 43 43 } 44 44 … … 126 126 127 127 } 128 // Running the test.129 $suite = new PHPUnit_TestSuite('UploadTest');130 $result = PHPUnit::run($suite);131 echo $result->toString(); -
branches/eli_branch/tests/UtilitiesTest.php
r438 r442 33 33 * Created with PHPUnit_Skeleton on 2005-08-09 34 34 */ 35 require_once 'PHPUnit.php'; 36 class UtilitiesTest extends PHPUnit_ TestCase {35 36 class UtilitiesTest extends PHPUnit_Framework_TestCase { 37 37 38 38 var $Utilities; … … 40 40 function UtilitiesTest($name) 41 41 { 42 $this->PHPUnit_ TestCase($name);42 $this->PHPUnit_Framework_TestCase($name); 43 43 } 44 44 … … 56 56 57 57 } 58 // Running the test.59 $suite = new PHPUnit_TestSuite('UtilitiesTest');60 $result = PHPUnit::run($suite);61 echo $result->toString(); -
branches/eli_branch/tests/VersionTest.php
r438 r442 30 30 * Created with PHPUnit_Skeleton on 2005-08-09 31 31 */ 32 require_once 'PHPUnit.php'; 33 class VersionTest extends PHPUnit_ TestCase {32 33 class VersionTest extends PHPUnit_Framework_TestCase { 34 34 35 35 var $Version; 36 36 var $Auth_SQL; 37 38 function VersionTest($name)39 {40 $this->PHPUnit_TestCase($name);41 }42 37 43 38 function setUp() … … 47 42 48 43 require_once '../lib/Auth_SQL.inc.php'; 49 $this->Auth_SQL = &new Auth_SQL('testauth');44 $this->Auth_SQL = new Auth_SQL('testauth'); 50 45 $this->Auth_SQL->setParam(array( 51 46 'db_table' => 'test_user_tbl', … … 116 111 { 117 112 $result = $this->Version->create('test_user_tbl', 'user_id', '1', 'Test User', 'First version of user'); 118 $this->assert True($result);113 $this->assertSame(1, $result); 119 114 } 120 115 … … 190 185 191 186 } 192 // Running the test.193 $suite = new PHPUnit_TestSuite('VersionTest');194 $result = PHPUnit::run($suite);195 echo $result->toString(); -
branches/eli_branch/tests/_config.inc.php
r438 r442 28 28 */ 29 29 require_once '../lib/App.inc.php'; 30 31 $_SERVER['DB_SERVER'] = 'localhost'; 32 $_SERVER['DB_USER'] = 'sc'; 33 $_SERVER['DB_NAME'] = 'sc_db'; 34 $_SERVER['DB_PASS'] = '1234'; 35 30 36 $app =& App::getInstance('testapp'); 31 37 … … 44 50 'db_die_on_failure' => true, 45 51 'db_server' => 'localhost', 46 'db_name' => 'test',47 'db_user' => 'root',52 'db_name' => getenv('DB_NAME'), 53 'db_user' => getenv('DB_USER'), 48 54 'db_pass' => getenv('DB_PASS'), 49 55 'display_errors' => true,
Note: See TracChangeset
for help on using the changeset viewer.