added setExpectedException and check empty($search)

This commit is contained in:
Vyacheslav Agafonov
2011-11-30 13:29:48 +04:00
parent be83874392
commit 69169590da
4 changed files with 36 additions and 19 deletions

View File

@ -22,6 +22,7 @@ class RedisDebugTest extends PHPUnit_Framework_TestCase
public function run(PHPUnit_Framework_TestResult $result = NULL)
{
$this->setPreserveGlobalState(false);
return parent::run($result);
}
@ -85,7 +86,6 @@ class RedisDebugTest extends PHPUnit_Framework_TestCase
}
/**
* @expectedException GeneralException
* @expectedExceptionMessage call_user_func_array() expects parameter 1 to be a valid callback
* @runInSeparateProcess
*/
@ -94,8 +94,10 @@ class RedisDebugTest extends PHPUnit_Framework_TestCase
if (!defined('DEBUG')) {
define('DEBUG', true);
}
$mock = $this->getMock('Redis', array('connect'));
$redisDebug = new RedisDebug($mock);
$this->setExpectedException('GeneralException');
$this->assertNull($redisDebug->nothing('localhost', 4322));
}
}