replacement @expectedException to setExpectedException

This commit is contained in:
Vyacheslav Agafonov
2011-12-01 12:15:44 +04:00
parent 0ade94a5ea
commit 3e1a5a0b28
3 changed files with 10 additions and 20 deletions

View File

@ -45,12 +45,10 @@ class PHPViewTest extends PHPUnit_Framework_TestCase
$this->assertEquals('vfs://root/views/', $this->view->getPath());
}
/**
* @expectedException InitializationException
* @expectedExceptionMessage Configuration must have a "path" set.
*/
public function testPHPViewNullConstructor()
{
$this->setExpectedException('InitializationException', 'Configuration must have a "path" set.');
$view = new PHPView(null);
}
@ -86,12 +84,10 @@ class PHPViewTest extends PHPUnit_Framework_TestCase
$this->assertContains('New title', Registry::get('TitleViewHelper'));
}
/**
* @expectedException GeneralException
* @expectedExceptionMessage View helper "WriteViewHelper" not found.
*/
public function testIllegalCall()
{
$this->setExpectedException('GeneralException', 'View helper "WriteViewHelper" not found.');
$this->view->write('tony');
}
@ -138,12 +134,9 @@ class PHPViewTest extends PHPUnit_Framework_TestCase
}
/**
* @expectedException GeneralException
* @expectedExceptionMessage Template
*/
public function testErrorTemplate()
{
$this->setExpectedException('GeneralException', 'Template');
$view = new PHPView(array('path' => 'error_path/'));
$result = $view->fetch('test');