mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
22 lines
763 B
PHP
22 lines
763 B
PHP
<?php
|
|
|
|
use Pest\Support\ExceptionTrace;
|
|
|
|
it('ensures the given closures reports the correct class name', function () {
|
|
$closure = function () {
|
|
throw new Exception('Call to undefined method P\Tests\IntentionallyNotExisting::testBasic().');
|
|
};
|
|
|
|
ExceptionTrace::ensure($closure);
|
|
})->throws(
|
|
Exception::class,
|
|
'Call to undefined method Tests\IntentionallyNotExisting::testBasic().',
|
|
);
|
|
|
|
it('ensures the given closures reports the correct class name and suggests the [uses()] function', function () {
|
|
$this->get();
|
|
})->throws(
|
|
Error::class,
|
|
'Call to undefined method Tests\Unit\Support\ExceptionTrace::get(). Did you forget to use the [pest()->extend()] function? Read more at: https://pestphp.com/docs/configuring-tests',
|
|
);
|