/**
* @expectedException PHPUnit_Framework_Error
*/
public function testFailingInclude()
{
include 'not_existing_file.php';
}
Solution 1:
/**
* @expectedException \PHPUnit\Framework\Error\Warning
*/
public function testFailingInclude()
{
include 'not_existing_file.php';
}
Solution 2:
public function testFailingInclude()
{
$this->expectException(\PHPUnit\Framework\Error\Error::class);
include 'not_existing_file.php';
}
No comments:
Post a Comment