Ignore:
Timestamp:
Jun 3, 2006 7:47:48 PM (18 years ago)
Author:
scdev
Message:

Q - Merged branches/2.0singleton into trunk. Completed updating classes to use singleton methods. Implemented tests. Fixed some bugs. Changed some interfaces.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/AppTest.php

    r42 r136  
    3232    function test_getinstance()
    3333    {
    34         $thisapp =& App::getinstance();
     34        $thisapp =& App::getInstance();
    3535        $this->assertTrue(serialize($thisapp) == serialize($this->App), 'Objects do not match across instantiations.');
    3636    }
     
    7171    function test_dbquery()
    7272    {
    73         $qid = DB::query("SELECT 2 + 2");
     73        $db =& DB::getInstance();
     74   
     75        $qid = $db->query("SELECT 2 + 2");
    7476        list($result) = mysql_fetch_row($qid);
    7577        $this->assertEquals('4', $result);
     
    7880    function test_raisemsg()
    7981    {
     82        $app =& App::getInstance();
    8083        $expected = 'My message';
    81         App::raiseMsg($expected, MSG_NOTICE, __FILE__, __LINE__);
    82         $msg = current($_SESSION[$this->App->app]['messages']);
     84        $app->raiseMsg($expected, MSG_NOTICE, __FILE__, __LINE__);
     85        $msg = current($_SESSION[$this->App->_ns]['messages']);
    8386        $this->assertEquals($expected, $msg['message']);
    8487    }
     
    8790    {
    8891        ob_start();
    89         App::printraisedmessages();
     92        $app =& App::getInstance();
     93        $app->printraisedmessages();
    9094        $result = ob_get_clean();
    9195        $this->assertContains('My message', $result, 'Raised message not found in output.');
     
    9498    function test_logmsg()
    9599    {
     100        $app =& App::getInstance();
    96101        $file = $this->App->getParam('log_directory') . '/' . $this->App->getParam('log_filename');
    97         App::logMsg('Test log message', LOG_DEBUG, __FILE__, __LINE__);
     102        $app->logMsg('Test log message', LOG_DEBUG, __FILE__, __LINE__);
    98103        if ($result = file($file)) {
    99104            $result = end($result);
     
    106111    function test_ohref()
    107112    {
     113        $app =& App::getInstance();
    108114        $_GET['arg1'] = 'A';
    109         $result = App::ohref('/some/url.php', array('arg1'), true);
     115        $result = $app->ohref('/some/url.php', array('arg1'), true);
    110116        $this->assertContains(session_name(), $result, 'SSID not found in URL.');
    111117        $this->assertContains('arg1=A', $result, 'Argument not passed through.');
     
    114120    function test_printhiddensession()
    115121    {
     122        $app =& App::getInstance();
    116123        ob_start();
    117         App::printhiddensession();
     124        $app->printhiddensession();
    118125        $result = ob_get_clean();
    119126        $this->assertContains(session_name(), $result);
     
    122129//     function test_dieurl()
    123130//     {
    124 //         App::dieURL('/die/to/this/url.php');
     131//         $app =& App::getInstance();
     132//         $app->dieURL('/die/to/this/url.php');
    125133//     }
    126134//
Note: See TracChangeset for help on using the changeset viewer.