replacement @expectedException to setExpectedException
This commit is contained in:
@ -19,21 +19,14 @@ require_once dirname(__FILE__) . '/../../exception/InitializationException.php';
|
||||
|
||||
class DbTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @expectedExceptionMessage Trying to get property of non-object
|
||||
*/
|
||||
public function testConnectNoParams()
|
||||
{
|
||||
$this->setExpectedException('InitializationException');
|
||||
$this->setExpectedException('InitializationException', 'Trying to get property of non-object');
|
||||
Db::connect();
|
||||
}
|
||||
/**
|
||||
* @expectedExceptionMessage Connection parameters must be an array
|
||||
*/
|
||||
public function testConnectConfigNotArray()
|
||||
{
|
||||
$this->setExpectedException('InitializationException');
|
||||
$this->setExpectedException('InitializationException', 'Connection parameters must be an array');
|
||||
Db::connect('name', 'config');
|
||||
}
|
||||
|
||||
@ -53,13 +46,11 @@ class DbTest extends PHPUnit_Framework_TestCase
|
||||
$driver = Db::connect('mysql', $conf);
|
||||
$this->assertInstanceOf('DbDriver', $driver);
|
||||
}
|
||||
/**
|
||||
* @expectedExceptionMessage Database driver must extends DbDriver
|
||||
*/
|
||||
|
||||
public function testConnectWithWrongDriver()
|
||||
{
|
||||
$this->setExpectedException('InitializationException', 'Database driver must extends DbDriver');
|
||||
$this->getMock('NotDbDriver', array(), array(), 'NoDbDriverMock');
|
||||
$this->setExpectedException('InitializationException');
|
||||
$driver = Db::connect('nodb', array('hostname' => 'localhost', 'driver' => 'NoDbDriverMock'));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user