replacement @expectedException to setExpectedException

This commit is contained in:
Vyacheslav Agafonov
2011-12-01 12:15:44 +04:00
parent 0ade94a5ea
commit 3e1a5a0b28
3 changed files with 10 additions and 20 deletions

View File

@ -28,19 +28,19 @@ class GetViewHelperTest extends PHPUnit_Framework_TestCase
/**
* @TODO: GetViewHelper: initialize GetViewHelper::$get with empty array()
* @expectedException PHPUnit_Framework_Error
*/
public function testGetWithNull()
{
$this->setExpectedException('PHPUnit_Framework_Error');
$this->helper->get(null);
}
/**
* @TODO: GetViewHelper: check $_GET not null
* @expectedException PHPUnit_Framework_Error
*/
public function testGetEmptyGET()
{
$this->setExpectedException('PHPUnit_Framework_Error');
$result = $this->helper->get('param');
}

View File

@ -15,7 +15,7 @@ require_once dirname(__FILE__) . '/../../../view/iView.php';
require_once dirname(__FILE__) . '/../../../view/PHPView.php';
require_once dirname(__FILE__) . '/../../../view/helpers/ViewHelper.php';
require_once dirname(__FILE__) . '/../../../view/helpers/MsgViewHelper.php';
require_once dirname(__FILE__) . '/../../../exception/InitializationException.php';
require_once dirname(__FILE__) . '/../../../exception/GeneralException.php';
class MsgViewHelperTest extends PHPUnit_Framework_TestCase
{
@ -39,13 +39,10 @@ class MsgViewHelperTest extends PHPUnit_Framework_TestCase
}
/**
* @expectedException GeneralException
* @expectedExceptionMessage Unknown message type
*/
public function testWrongType()
{
$this->setExpectedException('GeneralException', 'Unknown message type');
$this->helper->msg('some message', 'wrong');
}