allows()->post('https://api.dev.dwoodauto.com/api/v3/production.status', [ 'signature' => 'eretgfdsa34565432b453', 'data' => ['order_sn' => 'w45676543456'] ])->andReturn($response); $w = Mockery::mock(Order::class, ['mock-key'])->makePartial(); $w->allows()->getHttpClient()->andReturn($client); // $client 为上面创建的模拟实例。 $this->assertSame('', ''); } }