Skip to content

Commit cb9dd8c

Browse files
committed
fix some class not imported
1 parent 3bfc501 commit cb9dd8c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

test/BaseTestCase.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
use PHPUnit\Framework\TestCase;
66
use ReflectionException;
77
use ReflectionMethod;
8+
use RuntimeException;
9+
use Throwable;
810

911
/**
1012
* Class BaseTestCase
@@ -20,10 +22,10 @@ abstract class BaseTestCase extends TestCase
2022
* usage:
2123
*
2224
* ```php
23-
* $rftMth = $this->method($className, $protectedOrPrivateMethod)
25+
* $rftMth = $this->method(SomeClass::class, $protectedOrPrivateMethod)
2426
*
25-
* $obj = new $className();
26-
* $res = $rftMth->invokeArgs($obj, $invokeArgs);
27+
* $obj = new SomeClass();
28+
* $ret = $rftMth->invokeArgs($obj, $invokeArgs);
2729
* ```
2830
*
2931
* @param string|object $class
@@ -37,7 +39,7 @@ protected static function getMethod($class, string $method): ReflectionMethod
3739
// $class = new \ReflectionClass($class);
3840
// $method = $class->getMethod($method);
3941

40-
$method = new \ReflectionMethod($class, $method);
42+
$method = new ReflectionMethod($class, $method);
4143
$method->setAccessible(true);
4244

4345
return $method;
@@ -56,6 +58,6 @@ protected function runAndGetException(callable $cb): Throwable
5658
return $e;
5759
}
5860

59-
return new RuntimeException('NO ERROR');
61+
return new RuntimeException('NO ERROR', -1);
6062
}
6163
}

0 commit comments

Comments
 (0)