function TestMethodBuilder::fromCallStack
Throws
NoTestCaseObjectOnCallStackException
File
-
vendor/
phpunit/ phpunit/ src/ Event/ Value/ Test/ TestMethodBuilder.php, line 59
Class
- TestMethodBuilder
- @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
Namespace
PHPUnit\Event\CodeCode
public static function fromCallStack() : TestMethod {
foreach (debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS) as $frame) {
if (isset($frame['object']) && $frame['object'] instanceof TestCase) {
return $frame['object']->valueObjectForEvents();
}
}
throw new NoTestCaseObjectOnCallStackException();
}