replacement @expectedException to setExpectedException

This commit is contained in:
Vyacheslav Agafonov
2011-12-01 11:57:44 +04:00
parent 77f69b033d
commit 0b11f62c21

View File

@ -25,12 +25,10 @@ class RedisDebugTest extends PHPUnit_Framework_TestCase
return parent::run($result); return parent::run($result);
} }
/**
* @expectedException GeneralException
*/
public function testConstructException() public function testConstructException()
{ {
$this->setExpectedException('GeneralException');
$redisDebug = new RedisDebug('redis'); $redisDebug = new RedisDebug('redis');
} }
@ -86,7 +84,6 @@ class RedisDebugTest extends PHPUnit_Framework_TestCase
} }
/** /**
* @expectedExceptionMessage call_user_func_array() expects parameter 1 to be a valid callback
* @runInSeparateProcess * @runInSeparateProcess
*/ */
public function testCallUndefinedMethod() public function testCallUndefinedMethod()
@ -95,9 +92,11 @@ class RedisDebugTest extends PHPUnit_Framework_TestCase
define('DEBUG', true); define('DEBUG', true);
} }
$this->setExpectedException('GeneralException', 'call_user_func_array() expects parameter 1 to be a valid callback');
$mock = $this->getMock('Redis', array('connect')); $mock = $this->getMock('Redis', array('connect'));
$redisDebug = new RedisDebug($mock); $redisDebug = new RedisDebug($mock);
$this->setExpectedException('GeneralException'); $this->setExpectedException('GeneralException');
$this->assertNull($redisDebug->nothing('localhost', 4322)); $this->assertNull($redisDebug->nothing('localhost', 4322));
} }
} }