是否可以接受供应商代码在php中使用的类?

I'm using Laravel 5 framework.

I extended the Illuminate\Http\Request Class and added some functions. So I changed bootstrap to boot with my Custom Http Request Class. They work well.

But when it come to integrated test. by extending their TestCase, they use the Request class as below

use Illuminate\Http\Request;

$request = Request::create();

Is there a way for me to override their class from using Illuminate\Http\Request to use MyApp\Http\Request at my own class? I don't want to change their code.

No.

Their code calls it directly, so there's unfortunately nothing you can do.