File: test-method-builder-cannot-find-testcase-object.phpt

package info (click to toggle)
phpunit 12.3.5-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 50,160 kB
  • sloc: php: 101,772; xml: 2,084; makefile: 124; sh: 99
file content (15 lines) | stat: -rw-r--r-- 533 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
--TEST--
The right exception is raised when TestMethodBuilder::fromCallStack() cannot find a TestCase object
--SKIPIF--
<?php if(str_contains((string)ini_get('xdebug.mode'), 'develop')) {
print 'skip: xdebug.mode=develop is enabled';
}
--FILE--
<?php declare(strict_types=1);
require __DIR__ . '/../../bootstrap.php';

\PHPUnit\Event\Code\TestMethodBuilder::fromCallStack();
--EXPECTF--
Fatal error: Uncaught PHPUnit\Event\Code\NoTestCaseObjectOnCallStackException: Cannot find TestCase object on call stack in %s:%d
Stack trace:
%a