mirror of
https://github.com/filp/whoops.git
synced 2026-09-02 13:38:43 +00:00
39 lines
854 B
PHP
39 lines
854 B
PHP
<?php
|
|
/**
|
|
* Whoops - php errors for cool kids
|
|
* @author Filipe Dobreira <http://github.com/filp>
|
|
*/
|
|
|
|
namespace Whoops;
|
|
|
|
use PHPUnit\Framework\TestCase as BaseTestCase;
|
|
|
|
class TestCase extends BaseTestCase
|
|
{
|
|
/**
|
|
* @return Run
|
|
*/
|
|
protected function getRunInstance()
|
|
{
|
|
$run = new Run();
|
|
$run->allowQuit(false);
|
|
|
|
return $run;
|
|
}
|
|
|
|
/**
|
|
* @param object|string $class_or_object
|
|
* @param string $method
|
|
* @param mixed[] $args
|
|
* @return mixed
|
|
*/
|
|
public static function callPrivateMethod($class_or_object, $method, $args = [])
|
|
{
|
|
$ref = new \ReflectionMethod($class_or_object, $method);
|
|
$ref->setAccessible(true);
|
|
$object = is_object($class_or_object) ? $class_or_object : null;
|
|
|
|
return $ref->invokeArgs($object, $args);
|
|
}
|
|
}
|