Changeset 442 for branches/eli_branch/tests/AppTest.php
- Timestamp:
- Dec 6, 2013 7:17:37 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 */
Note: See TracChangeset
for help on using the changeset viewer.