mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
Merge pull request #745 from dansysanalyst/improve_exception_message
Slightly Improvement on Exception message
This commit is contained in:
@ -33,7 +33,7 @@ final class ExceptionTrace
|
||||
$message = str_replace(self::UNDEFINED_METHOD, 'Call to undefined method ', $message);
|
||||
|
||||
if (class_exists($class) && count(class_parents($class)) > 0 && array_values(class_parents($class))[0] === TestCase::class) {
|
||||
$message .= '. Did you forget to use the [uses()] function? https://pestphp.com/docs/configuring-tests';
|
||||
$message .= '. Did you forget to use the [uses()] function? Read more at: https://pestphp.com/docs/configuring-tests';
|
||||
}
|
||||
|
||||
Reflection::setPropertyValue($throwable, 'message', $message);
|
||||
|
||||
@ -17,5 +17,5 @@ it('ensures the given closures reports the correct class name and suggests the [
|
||||
$this->get();
|
||||
})->throws(
|
||||
Error::class,
|
||||
'Call to undefined method Tests\Unit\Support\ExceptionTrace::get(). Did you forget to use the [uses()] function? https://pestphp.com/docs/configuring-tests',
|
||||
'Call to undefined method Tests\Unit\Support\ExceptionTrace::get(). Did you forget to use the [uses()] function? Read more at: https://pestphp.com/docs/configuring-tests',
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user