improve message

This commit is contained in:
Dan Ang
2023-03-28 12:19:15 +01:00
parent bf14c4262a
commit e48bd31ae4
2 changed files with 2 additions and 2 deletions

View File

@ -33,7 +33,7 @@ final class ExceptionTrace
$message = str_replace(self::UNDEFINED_METHOD, 'Call to undefined method ', $message); $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) { 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); Reflection::setPropertyValue($throwable, 'message', $message);

View File

@ -17,5 +17,5 @@ it('ensures the given closures reports the correct class name and suggests the [
$this->get(); $this->get();
})->throws( })->throws(
Error::class, 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',
); );