use PHPUnit\Framework\TestCase;
use Symfony\Component\ErrorHandler\Error\UndefinedMethodError;
use Symfony\Component\ErrorHandler\ErrorEnhancer\UndefinedMethodErrorEnhancer;
class UndefinedMethodErrorEnhancerTest extends TestCase
{ /**
* @dataProvider provideUndefinedMethodData
*/
public function testEnhance(string
$originalMessage, string
$enhancedMessage) { $enhancer =
new UndefinedMethodErrorEnhancer();
$expectedLine = __LINE__ + 1;
$error =
$enhancer->
enhance(new \
Error($originalMessage));
$this->
assertInstanceOf(UndefinedMethodError::
class,
$error);
$this->
assertSame($enhancedMessage,
$error->
getMessage());
$this->
assertSame(realpath(__FILE__
),
$error->
getFile());
$this->
assertSame($expectedLine,
$error->
getLine());
} public static function provideUndefinedMethodData() {