Changeset 136 for trunk/tests/AppTest.php
- Timestamp:
- Jun 3, 2006 7:47:48 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/AppTest.php
r42 r136 32 32 function test_getinstance() 33 33 { 34 $thisapp =& App::get instance();34 $thisapp =& App::getInstance(); 35 35 $this->assertTrue(serialize($thisapp) == serialize($this->App), 'Objects do not match across instantiations.'); 36 36 } … … 71 71 function test_dbquery() 72 72 { 73 $qid = DB::query("SELECT 2 + 2"); 73 $db =& DB::getInstance(); 74 75 $qid = $db->query("SELECT 2 + 2"); 74 76 list($result) = mysql_fetch_row($qid); 75 77 $this->assertEquals('4', $result); … … 78 80 function test_raisemsg() 79 81 { 82 $app =& App::getInstance(); 80 83 $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']); 83 86 $this->assertEquals($expected, $msg['message']); 84 87 } … … 87 90 { 88 91 ob_start(); 89 App::printraisedmessages(); 92 $app =& App::getInstance(); 93 $app->printraisedmessages(); 90 94 $result = ob_get_clean(); 91 95 $this->assertContains('My message', $result, 'Raised message not found in output.'); … … 94 98 function test_logmsg() 95 99 { 100 $app =& App::getInstance(); 96 101 $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__); 98 103 if ($result = file($file)) { 99 104 $result = end($result); … … 106 111 function test_ohref() 107 112 { 113 $app =& App::getInstance(); 108 114 $_GET['arg1'] = 'A'; 109 $result = App::ohref('/some/url.php', array('arg1'), true);115 $result = $app->ohref('/some/url.php', array('arg1'), true); 110 116 $this->assertContains(session_name(), $result, 'SSID not found in URL.'); 111 117 $this->assertContains('arg1=A', $result, 'Argument not passed through.'); … … 114 120 function test_printhiddensession() 115 121 { 122 $app =& App::getInstance(); 116 123 ob_start(); 117 App::printhiddensession();124 $app->printhiddensession(); 118 125 $result = ob_get_clean(); 119 126 $this->assertContains(session_name(), $result); … … 122 129 // function test_dieurl() 123 130 // { 124 // App::dieURL('/die/to/this/url.php'); 131 // $app =& App::getInstance(); 132 // $app->dieURL('/die/to/this/url.php'); 125 133 // } 126 134 //
Note: See TracChangeset
for help on using the changeset viewer.