55use PHPUnit \Framework \TestCase ;
66use ReflectionException ;
77use 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