Changeset 442 for branches


Ignore:
Timestamp:
Dec 6, 2013 7:17:37 PM (10 years ago)
Author:
anonymous
Message:

phpunit tests now work with phpunit 3.7

Location:
branches/eli_branch
Files:
4 added
28 edited

Legend:

Unmodified
Added
Removed
  • branches/eli_branch/lib/App.inc.php

    r439 r442  
    3030 */
    3131
     32//ob_start();
     33 
    3234// Message Types.
    3335define('MSG_ERR', 1);
     
    244246
    245247        // Error reporting.
     248        /*
    246249        ini_set('error_reporting', $this->getParam('error_reporting'));
    247250        ini_set('display_errors', $this->getParam('display_errors'));
     
    250253            ini_set('error_log', $this->getParam('log_directory') . '/' . $this->getParam('php_error_log'));
    251254        }
    252 
     255*/
    253256        // Set character set to use for multi-byte string functions.
    254257        mb_internal_encoding($this->getParam('character_set'));
     
    273276
    274277        if (true === $this->getParam('enable_db')) {
    275 
     278           
    276279            // DB connection parameters taken from environment variables in the httpd.conf file, readable only by root.
    277280            if (!empty($_SERVER['DB_SERVER'])) {
     
    319322
    320323            // Session parameters.
     324            /*
    321325            ini_set('session.gc_probability', 1);
    322326            ini_set('session.gc_divisor', 1000);
     
    327331            ini_set('session.entropy_length', '512');
    328332            ini_set('session.cookie_httponly', true);
     333             * */
    329334            session_name($this->getParam('session_name'));
    330335
     
    339344
    340345            // Start the session.
    341             session_start();
     346            //session_start();
    342347
    343348            if (!isset($_SESSION['_app'][$this->_ns])) {
     
    374379
    375380        // 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'));
    377382       
    378383        // Set the version of the codebase we're using.
     
    381386            $codebase_version = trim(file_get_contents($codebase_version_file));
    382387            $this->setParam(array('codebase_version' => $codebase_version));
    383             header('X-Codebase-Version: ' . $codebase_version);
     388            //header('X-Codebase-Version: ' . $codebase_version);
    384389        }
    385390
     
    397402    {
    398403        session_write_close();
    399         restore_include_path();
    400404        $this->running = false;
    401405        $num_queries = 0;
     
    449453            );
    450454        }
    451 
     455       
    452456        if (!in_array($type, array(MSG_NOTICE, MSG_SUCCESS, MSG_WARNING, MSG_ERR))) {
    453457            $this->logMsg(sprintf('Invalid MSG_* type: %s', $type), LOG_NOTICE, __FILE__, __LINE__);
     
    469473            return false;
    470474        }
    471 
     475        //die($_SESSION['_app'][$this->_ns]['messages']);
    472476        return isset($_SESSION['_app'][$this->_ns]['messages']) ? $_SESSION['_app'][$this->_ns]['messages'] : array();
    473477    }
     
    503507    public function printRaisedMessages($above='', $below='', $print_gotohash_js=false, $hash='sc-msg')
    504508    {
     509       
    505510        if (!$this->running) {
    506511            $this->logMsg(sprintf('Canceled method call %s, application not running.', __FUNCTION__), LOG_NOTICE, __FILE__, __LINE__);
  • branches/eli_branch/lib/Lock.inc.php

    r439 r442  
    350350     * Deletes all locks that are older than auto_timeout.
    351351     */
    352     private function _auto_timeout()
     352    public function _auto_timeout()
    353353    {
    354354        $db =& DB::getInstance();
  • branches/eli_branch/tests/AppTest.php

    r438 r442  
    3030 * Created with PHPUnit_Skeleton on 2005-08-09
    3131 */
    32 require_once 'PHPUnit.php';
    33 class AppTest extends PHPUnit_TestCase {
     32//
     33
     34class AppTest extends PHPUnit_Framework_TestCase {
    3435
    3536    var $App;
    36 
    37     function AppTest($name)
    38     {
    39         $this->PHPUnit_TestCase($name);
    40     }
     37   
     38    static $shared_session;
    4139
    4240    function setUp()
     
    4442        require dirname(__FILE__) . '/_config.inc.php';
    4543        $this->App =& $app;
     44        $_SESSION = AppTest::$shared_session;
    4645    }
    4746
     
    4948    {
    5049        unset($this->App);
     50        AppTest::$shared_session = $_SESSION;
    5151    }
    5252
     
    6262            'test_config_value' => 1234
    6363        ));
    64         $this->assertTrue(1234 === $this->App->_params['test_config_value']);
     64        $this->assertTrue(1234 === $this->App->getParam('test_config_value'));
    6565    }
    6666
    6767    function test_getParam()
    6868    {
    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        ));
    7073        $result = $this->App->getParam('test_config_value2');
    7174        $this->assertEquals('okay', $result);
     
    104107        $expected = 'My message';
    105108        $app->raiseMsg($expected, MSG_NOTICE, __FILE__, __LINE__);
    106         $msg = current($_SESSION['_app'][$this->App->_ns]['messages']);
     109        $msg = current($_SESSION['_app']['testapp']['messages']);
    107110        $this->assertEquals($expected, $msg['message']);
    108111    }
     
    111114    {
    112115        ob_start();
     116        //$this->test_raisemsg();  //had to add this line for phpunit ver. 3.7
    113117        $app =& App::getInstance();
    114118        $app->printraisedmessages();
     
    205209}
    206210// Running the test.
     211/*
    207212$suite = new PHPUnit_TestSuite('AppTest');
    208213$result = PHPUnit::run($suite);
    209214echo $result->toString();
     215 */
  • branches/eli_branch/tests/AuthorizeNetTest.php

    r438 r442  
    3030 * Created with PHPUnit_Skeleton on 2005-08-09
    3131 */
    32 require_once 'PHPUnit.php';
    33 class AuthorizeNetTest extends PHPUnit_TestCase {
     32
     33class AuthorizeNetTest extends PHPUnit_Framework_TestCase {
    3434
    3535    var $AuthorizeNet;
    36 
    37     function AuthorizeNetTest($name)
    38     {
    39         $this->PHPUnit_TestCase($name);
    40     }
    41 
     36   
     37    static $shared_session;
     38   
    4239    function setUp()
    4340    {
     
    4542        require_once '../lib/AuthorizeNet.inc.php';
    4643
    47         $this->AuthorizeNet =& new AuthorizeNet();
     44        $this->AuthorizeNet = new AuthorizeNet();
    4845        $this->AuthorizeNet->setParam(array(
    4946            'x_login' => 'myaccount',
     
    6158            'x_zip' => '75010',
    6259        ));
     60        $_SESSION = AuthorizeNetTest::$shared_session;
    6361    }
    6462
     
    6664    {
    6765        unset($this->AuthorizeNet);
     66        AuthorizeNetTest::$shared_session = $_SESSION;
    6867    }
    6968
     
    7170    {
    7271        $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'));
    7473    }
    7574
     
    119118
    120119}
    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  
    3030 * Created with PHPUnit_Skeleton on 2005-08-09
    3131 */
    32 require_once 'PHPUnit.php';
    33 class CSSTest extends PHPUnit_TestCase {
     32
     33class CSSTest extends PHPUnit_Framework_TestCase {
    3434
    3535    var $CSS;
    3636    var $test_css_file;
    37 
    38     function CSSTest($name)
    39     {
    40         $this->PHPUnit_TestCase($name);
    41     }
    4237
    4338    function setUp()
     
    4641        $this->test_css_file = dirname(__FILE__) . '/../css/codebase.inc.css';
    4742        require_once '../lib/CSS.inc.php';
    48         $this->CSS =& new CSS();
     43        $this->CSS = new CSS();
    4944        $this->CSS->setFile($this->test_css_file);
    5045    }
     
    8681
    8782}
    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  
    3333 * Created with PHPUnit_Skeleton on 2005-08-09
    3434 */
    35 require_once 'PHPUnit.php';
    36 class CacheTest extends PHPUnit_TestCase {
     35
     36class CacheTest extends PHPUnit_Framework_TestCase {
    3737
    3838    var $Cache;
     
    4040    function CacheTest($name)
    4141    {
    42         $this->PHPUnit_TestCase($name);
     42        $this->PHPUnit_Framework_TestCase($name);
    4343    }
    4444
     
    105105
    106106}
    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  
    3030 * Created with PHPUnit_Skeleton on 2005-08-09
    3131 */
    32 require_once 'PHPUnit.php';
    33 class DBSessionHandlerTest extends PHPUnit_TestCase {
     32
     33class DBSessionHandlerTest extends PHPUnit_Framework_TestCase {
    3434
    3535    var $DBSessionHandler;
    36 
    37     function DBSessionHandlerTest($name)
    38     {
    39         $this->PHPUnit_TestCase($name);
    40     }
    4136
    4237    function setUp()
     
    8782
    8883}
    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  
    11<?php
     2
    23/**
    34 * The Strangecode Codebase - a general application development framework for PHP
     
    3031 * Created with PHPUnit_Skeleton on 2005-12-01
    3132 */
    32 require_once 'PHPUnit.php';
    33 class EmailTest extends PHPUnit_TestCase {
     33
     34class EmailTest extends PHPUnit_Framework_TestCase {
    3435
    3536    var $Email;
    36 
    37     function EmailTest($name)
    38     {
    39         $this->PHPUnit_TestCase($name);
    40     }
    4137
    4238    function setUp()
     
    4440        require dirname(__FILE__) . '/_config.inc.php';
    4541        require_once '../lib/Email.inc.php';
    46         $this->Email =& new Email();
     42        $this->Email = new Email();
    4743    }
    4844
     
    122118
    123119}
    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  
    3030 * Created with PHPUnit_Skeleton on 2005-08-09
    3131 */
    32 require_once 'PHPUnit.php';
    33 class FormValidatorTest extends PHPUnit_TestCase {
     32
     33class FormValidatorTest extends PHPUnit_Framework_TestCase {
    3434
    3535    var $FormValidator;
    36 
    37     function FormValidatorTest($name)
    38     {
    39         $this->PHPUnit_TestCase($name);
    40     }
    4136
    4237    function setUp()
     
    4439        require dirname(__FILE__) . '/_config.inc.php';
    4540        require_once '../lib/FormValidator.inc.php';
    46         $this->FormValidator =& new FormValidator();
     41        $this->FormValidator = new FormValidator();
    4742    }
    4843
     
    294289
    295290}
    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  
    3333 * Created with PHPUnit_Skeleton on 2005-08-09
    3434 */
    35 require_once 'PHPUnit.php';
    36 class GoogleAPITest extends PHPUnit_TestCase {
     35
     36class GoogleAPITest extends PHPUnit_Framework_TestCase {
    3737
    3838    var $GoogleAPI;
     
    4040    function GoogleAPITest($name)
    4141    {
    42         $this->PHPUnit_TestCase($name);
     42        $this->PHPUnit_Framework_TestCase($name);
    4343    }
    4444
     
    9191
    9292}
    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  
    3333 * Created with PHPUnit_Skeleton on 2005-08-09
    3434 */
    35 require_once 'PHPUnit.php';
    36 class HierarchyTest extends PHPUnit_TestCase {
     35
     36class HierarchyTest extends PHPUnit_Framework_TestCase {
    3737
    3838    var $Hierarchy;
     
    4040    function HierarchyTest($name)
    4141    {
    42         $this->PHPUnit_TestCase($name);
     42        $this->PHPUnit_Framework_TestCase($name);
    4343    }
    4444
     
    175175
    176176}
    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  
    3333 * Created with PHPUnit_Skeleton on 2005-08-09
    3434 */
    35 require_once 'PHPUnit.php';
    36 class ImageThumbTest extends PHPUnit_TestCase {
     35
     36class ImageThumbTest extends PHPUnit_Framework_TestCase {
    3737
    3838    var $ImageThumb;
     
    4040    function ImageThumbTest($name)
    4141    {
    42         $this->PHPUnit_TestCase($name);
     42        $this->PHPUnit_Framework_TestCase($name);
    4343    }
    4444
     
    119119
    120120}
    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  
    3030 * Created with PHPUnit_Skeleton on 2005-08-09
    3131 */
    32 require_once 'PHPUnit.php';
    33 class LockTest extends PHPUnit_TestCase {
     32
     33class LockTest extends PHPUnit_Framework_TestCase {
    3434
    3535    var $Lock;
    3636    var $Auth_SQL;
    37 
    38     function LockTest($name)
    39     {
    40         $this->PHPUnit_TestCase($name);
    41     }
    4237
    4338    function setUp()
     
    4742        require_once '../lib/Auth_SQL.inc.php';
    4843
    49         $this->Auth_SQL =& new Auth_SQL('test');
     44        $this->Auth_SQL = new Auth_SQL('test');
    5045        $this->Auth_SQL->setParam(array(
    5146            'db_table'          => 'test_user_tbl',
     
    208203    {
    209204        $result = $this->Lock->getsecondselapsed();
    210         $this->assertType('integer', $result);
     205        $this->assertInternalType('integer', $result);
    211206    }
    212207
    213208}
    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  
    3333 * Created with PHPUnit_Skeleton on 2005-08-09
    3434 */
    35 require_once 'PHPUnit.php';
    36 class MCVETest extends PHPUnit_TestCase {
     35
     36class MCVETest extends PHPUnit_Framework_TestCase {
    3737
    3838    var $MCVE;
     
    4040    function MCVETest($name)
    4141    {
    42         $this->PHPUnit_TestCase($name);
     42        $this->PHPUnit_Framework_TestCase($name);
    4343    }
    4444
     
    9191
    9292}
    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  
    3333 * Created with PHPUnit_Skeleton on 2005-08-09
    3434 */
    35 require_once 'PHPUnit.php';
    36 class NavigationTest extends PHPUnit_TestCase {
     35
     36class NavigationTest extends PHPUnit_Framework_TestCase {
    3737
    3838    var $Navigation;
     
    4040    function NavigationTest($name)
    4141    {
    42         $this->PHPUnit_TestCase($name);
     42        $this->PHPUnit_Framework_TestCase($name);
    4343    }
    4444
     
    133133
    134134}
    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  
    3333 * Created with PHPUnit_Skeleton on 2005-08-09
    3434 */
    35 require_once 'PHPUnit.php';
    36 class PEditTest extends PHPUnit_TestCase {
     35
     36class PEditTest extends PHPUnit_Framework_TestCase {
    3737
    3838    var $PEdit;
     
    4040    function PEditTest($name)
    4141    {
    42         $this->PHPUnit_TestCase($name);
     42        $this->PHPUnit_Framework_TestCase($name);
    4343    }
    4444
     
    154154
    155155}
    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  
    3333 * Created with PHPUnit_Skeleton on 2005-08-09
    3434 */
    35 require_once 'PHPUnit.php';
    36 class PageNumbersTest extends PHPUnit_TestCase {
     35
     36class PageNumbersTest extends PHPUnit_Framework_TestCase {
    3737
    3838    var $PageNumbers;
     
    4040    function PageNumbersTest($name)
    4141    {
    42         $this->PHPUnit_TestCase($name);
     42        $this->PHPUnit_Framework_TestCase($name);
    4343    }
    4444
     
    133133
    134134}
    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  
    3333 * Created with PHPUnit_Skeleton on 2005-08-09
    3434 */
    35 require_once 'PHPUnit.php';
    36 class PageSequenceTest extends PHPUnit_TestCase {
     35
     36class PageSequenceTest extends PHPUnit_Framework_TestCase {
    3737
    3838    var $PageSequence;
     
    4040    function PageSequenceTest($name)
    4141    {
    42         $this->PHPUnit_TestCase($name);
     42        $this->PHPUnit_Framework_TestCase($name);
    4343    }
    4444
     
    182182
    183183}
    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  
    3030 * Created with PHPUnit_Skeleton on 2005-08-09
    3131 */
    32 require_once 'PHPUnit.php';
    33 class PayPalTest extends PHPUnit_TestCase {
     32
     33class PayPalTest extends PHPUnit_Framework_TestCase {
    3434
    3535    var $PayPal;
    36 
    37     function PayPalTest($name)
    38     {
    39         $this->PHPUnit_TestCase($name);
    40     }
    4136
    4237    function setUp()
     
    4439        require dirname(__FILE__) . '/_config.inc.php';
    4540        require_once '../lib/PayPal.inc.php';
    46         $this->PayPal =& new PayPal();
     41        $this->PayPal = new PayPal();
    4742
    4843        // Defaults for purchasing classified postings.
     
    9085        ));
    9186        $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));
    9389    }
    9490
     
    10399        $this->PayPal->printbutton('testitem');
    104100        $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       
    106104    }
    107105
     
    134132
    135133}
    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  
    3333 * Created with PHPUnit_Skeleton on 2005-08-09
    3434 */
    35 require_once 'PHPUnit.php';
    36 class PrefsTest extends PHPUnit_TestCase {
     35
     36class PrefsTest extends PHPUnit_Framework_TestCase {
    3737
    3838    var $Prefs;
     
    4040    function PrefsTest($name)
    4141    {
    42         $this->PHPUnit_TestCase($name);
     42        $this->PHPUnit_Framework_TestCase($name);
    4343    }
    4444
     
    112112
    113113}
    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  
    3333 * Created with PHPUnit_Skeleton on 2005-08-09
    3434 */
    35 require_once 'PHPUnit.php';
    36 class ScriptTimerTest extends PHPUnit_TestCase {
     35
     36class ScriptTimerTest extends PHPUnit_Framework_TestCase {
    3737
    3838    var $ScriptTimer;
     
    4040    function ScriptTimerTest($name)
    4141    {
    42         $this->PHPUnit_TestCase($name);
     42        $this->PHPUnit_Framework_TestCase($name);
    4343    }
    4444
     
    7777
    7878}
    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  
    3333 * Created with PHPUnit_Skeleton on 2005-08-09
    3434 */
    35 require_once 'PHPUnit.php';
    36 class SortOrderTest extends PHPUnit_TestCase {
     35
     36class SortOrderTest extends PHPUnit_Framework_TestCase {
    3737
    3838    var $SortOrder;
     
    4040    function SortOrderTest($name)
    4141    {
    42         $this->PHPUnit_TestCase($name);
     42        $this->PHPUnit_Framework_TestCase($name);
    4343    }
    4444
     
    9191
    9292}
    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  
    3333 * Created with PHPUnit_Skeleton on 2005-08-09
    3434 */
    35 require_once 'PHPUnit.php';
    36 class SpellCheckTest extends PHPUnit_TestCase {
     35
     36class SpellCheckTest extends PHPUnit_Framework_TestCase {
    3737
    3838    var $SpellCheck;
     
    4040    function SpellCheckTest($name)
    4141    {
    42         $this->PHPUnit_TestCase($name);
     42        $this->PHPUnit_Framework_TestCase($name);
    4343    }
    4444
     
    154154
    155155}
    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  
    3333 * Created with PHPUnit_Skeleton on 2005-08-09
    3434 */
    35 require_once 'PHPUnit.php';
    36 class TemplateGlueTest extends PHPUnit_TestCase {
     35
     36class TemplateGlueTest extends PHPUnit_Framework_TestCase {
    3737
    3838    var $TemplateGlue;
     
    4040    function TemplateGlueTest($name)
    4141    {
    42         $this->PHPUnit_TestCase($name);
     42        $this->PHPUnit_Framework_TestCase($name);
    4343    }
    4444
     
    5656
    5757}
    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  
    3333 * Created with PHPUnit_Skeleton on 2005-08-09
    3434 */
    35 require_once 'PHPUnit.php';
    36 class UploadTest extends PHPUnit_TestCase {
     35
     36class UploadTest extends PHPUnit_Framework_TestCase {
    3737
    3838    var $Upload;
     
    4040    function UploadTest($name)
    4141    {
    42         $this->PHPUnit_TestCase($name);
     42        $this->PHPUnit_Framework_TestCase($name);
    4343    }
    4444
     
    126126
    127127}
    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  
    3333 * Created with PHPUnit_Skeleton on 2005-08-09
    3434 */
    35 require_once 'PHPUnit.php';
    36 class UtilitiesTest extends PHPUnit_TestCase {
     35
     36class UtilitiesTest extends PHPUnit_Framework_TestCase {
    3737
    3838    var $Utilities;
     
    4040    function UtilitiesTest($name)
    4141    {
    42         $this->PHPUnit_TestCase($name);
     42        $this->PHPUnit_Framework_TestCase($name);
    4343    }
    4444
     
    5656
    5757}
    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  
    3030 * Created with PHPUnit_Skeleton on 2005-08-09
    3131 */
    32 require_once 'PHPUnit.php';
    33 class VersionTest extends PHPUnit_TestCase {
     32
     33class VersionTest extends PHPUnit_Framework_TestCase {
    3434
    3535    var $Version;
    3636    var $Auth_SQL;
    37 
    38     function VersionTest($name)
    39     {
    40         $this->PHPUnit_TestCase($name);
    41     }
    4237
    4338    function setUp()
     
    4742
    4843        require_once '../lib/Auth_SQL.inc.php';
    49         $this->Auth_SQL =& new Auth_SQL('testauth');
     44        $this->Auth_SQL = new Auth_SQL('testauth');
    5045        $this->Auth_SQL->setParam(array(
    5146            'db_table'          => 'test_user_tbl',
     
    116111    {
    117112        $result = $this->Version->create('test_user_tbl', 'user_id', '1', 'Test User', 'First version of user');
    118         $this->assertTrue($result);
     113        $this->assertSame(1, $result);
    119114    }
    120115
     
    190185
    191186}
    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  
    2828*/
    2929require_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
    3036$app =& App::getInstance('testapp');
    3137
     
    4450    'db_die_on_failure' => true,
    4551    'db_server' => 'localhost',
    46     'db_name' => 'test',
    47     'db_user' => 'root',
     52    'db_name' => getenv('DB_NAME'),
     53    'db_user' => getenv('DB_USER'),
    4854    'db_pass' => getenv('DB_PASS'),
    4955    'display_errors' => true,
Note: See TracChangeset for help on using the changeset viewer.