use PHPUnit\Framework\TestCase;
use Symfony\Component\ErrorHandler\Error\UndefinedFunctionError;
use Symfony\Component\ErrorHandler\ErrorEnhancer\UndefinedFunctionErrorEnhancer;
class UndefinedFunctionErrorEnhancerTest extends TestCase
{ /**
* @dataProvider provideUndefinedFunctionData
*/
public function testEnhance(string
$originalMessage, string
$enhancedMessage) { $enhancer =
new UndefinedFunctionErrorEnhancer();
$expectedLine = __LINE__ + 1;
$error =
$enhancer->
enhance(new \
Error($originalMessage));
$this->
assertInstanceOf(UndefinedFunctionError::
class,
$error);
// class names are case insensitive and PHP do not return the same
$this->
assertSame(strtolower($enhancedMessage),
strtolower($error->
getMessage()));
$this->
assertSame(realpath(__FILE__
),
$error->
getFile());
$this->
assertSame($expectedLine,
$error->
getLine());
}