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

phpunit tests now work with phpunit 3.7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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 */
Note: See TracChangeset for help on using the changeset viewer.