Changeset 468 for trunk/tests/AppTest.php
- Timestamp:
- Feb 20, 2014 3:03:59 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property
svn:mergeinfo
set to
/branches/eli_branch merged eligible
-
Property
svn:mergeinfo
set to
-
trunk/tests/AppTest.php
r396 r468 4 4 * For details visit the project site: <http://trac.strangecode.com/codebase/> 5 5 * Copyright 2001-2012 Strangecode, LLC 6 * 6 * 7 7 * This file is part of The Strangecode Codebase. 8 8 * … … 11 11 * Free Software Foundation, either version 3 of the License, or (at your option) 12 12 * any later version. 13 * 13 * 14 14 * The Strangecode Codebase is distributed in the hope that it will be useful, but 15 15 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 16 16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 17 17 * details. 18 * 18 * 19 19 * You should have received a copy of the GNU General Public License along with 20 20 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>. … … 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 class AppTest extends PHPUnit_Framework_TestCase { 34 34 35 35 var $App; 36 36 37 function AppTest($name) 38 { 39 $this->PHPUnit_TestCase($name); 40 } 37 static $shared_session; 41 38 42 39 function setUp() … … 44 41 require dirname(__FILE__) . '/_config.inc.php'; 45 42 $this->App =& $app; 43 $_SESSION = AppTest::$shared_session; 46 44 } 47 45 … … 49 47 { 50 48 unset($this->App); 49 AppTest::$shared_session = $_SESSION; 51 50 } 52 51 … … 62 61 'test_config_value' => 1234 63 62 )); 64 $this->assertTrue(1234 === $this->App-> _params['test_config_value']);63 $this->assertTrue(1234 === $this->App->getParam('test_config_value')); 65 64 } 66 65 67 66 function test_getParam() 68 67 { 69 $this->App->_params['test_config_value2'] = 'okay'; 68 //$this->App->setParam('test_config_value2', 'okay'); 69 $this->App->setParam(array( 70 'test_config_value2' => 'okay' 71 )); 70 72 $result = $this->App->getParam('test_config_value2'); 71 73 $this->assertEquals('okay', $result); … … 93 95 { 94 96 $db =& DB::getInstance(); 95 97 96 98 $qid = $db->query("SELECT 2 + 2"); 97 99 list($result) = mysql_fetch_row($qid); … … 104 106 $expected = 'My message'; 105 107 $app->raiseMsg($expected, MSG_NOTICE, __FILE__, __LINE__); 106 $msg = current($_SESSION['_app'][ $this->App->_ns]['messages']);108 $msg = current($_SESSION['_app']['testapp']['messages']); 107 109 $this->assertEquals($expected, $msg['message']); 108 110 } … … 111 113 { 112 114 ob_start(); 115 $this->test_raisemsg(); //had to add this line for phpunit ver. 3.7 /// 113 116 $app =& App::getInstance(); 114 117 $app->printraisedmessages(); … … 205 208 } 206 209 // Running the test. 210 /* 207 211 $suite = new PHPUnit_TestSuite('AppTest'); 208 212 $result = PHPUnit::run($suite); 209 213 echo $result->toString(); 210 ?> 214 */
Note: See TracChangeset
for help on using the changeset viewer.