replacement @expectedException to setExpectedException

This commit is contained in:
Vyacheslav Agafonov
2011-12-01 17:35:13 +04:00
parent c214995796
commit 66857702b6
7 changed files with 22 additions and 46 deletions

View File

@ -64,14 +64,13 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
/**
* @runInSeparateProcess
* @expectedException GeneralException
* @expectedExceptionMessage ERROR
*/
public function testDriverExecuteNoResult()
{
if (!defined('DEBUG')) {
define('DEBUG', false);
}
$this->setExpectedException('GeneralException', 'ERROR');
$this->setDriverGetConnectionWrongResultMethod();
$this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val'));
}
@ -158,19 +157,16 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
*/
public function testNumRows()
{
$this->markTestSkipped();
$this->markTestSkipped('Unable to execute a method or access a property of an incomplete object.');
if (!defined('DEBUG')) {
define('DEBUG', false);
}
$this->setDriverGetConnectionMethod();
$this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val'));
$this->assertNull($this->stmt->numRows());
}
/**
* @expectedException GeneralException
* @expectedExceptionMessage Invalid fetch mode
* @runInSeparateProcess
*/
public function testFetchInvalidMode()
@ -178,6 +174,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
if (!defined('DEBUG')) {
define('DEBUG', false);
}
$this->setExpectedException('GeneralException');
$this->setDriverGetConnectionMethod();
$this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val'));
$this->stmt->fetch(324);