replacement @expectedException to setExpectedException

This commit is contained in:
Vyacheslav Agafonov
2011-12-01 12:01:57 +04:00
parent 3470e3254f
commit 4b95befdfe

View File

@ -50,8 +50,8 @@ class FileLoggerTest extends PHPUnit_Framework_TestCase
/** /**
* @runInSeparateProcess * @runInSeparateProcess
* @expectedException GeneralException * @expected Exception GeneralException
* @expectedExceptionMessage Could not open file /log.txt * @expected ExceptionMessage Could not open file /log.txt
*/ */
public function testCannotWrite() public function testCannotWrite()
{ {
@ -59,6 +59,7 @@ class FileLoggerTest extends PHPUnit_Framework_TestCase
define('DEBUG', true); define('DEBUG', true);
} }
$conf = array('logger' => 'FileLogger', 'filepath' => '/log.txt'); $conf = array('logger' => 'FileLogger', 'filepath' => '/log.txt');
$this->setExpectedException('GeneralException', 'Could not open file /log.txt');
Config::set('Logger', $conf); Config::set('Logger', $conf);
$logger = Logger::getInstance()->log('new msg'); $logger = Logger::getInstance()->log('new msg');
$this->assertFileNotExists('log.txt'); $this->assertFileNotExists('log.txt');