getConfig())->mini->setMockHandler([$mockHandler])->jsapi($order); $this->assertArrayHasKey('response', $response); $this->assertEquals([ 'appId', 'timeStamp', 'nonceStr', 'package', 'signType', 'paySign', 'merchantId', 'merchantName', 'channelId', 'channelName' ], array_keys($response['response'])); } public function testOfficialAccountJsapi() { $order = new CreateOrder('当天挂号', 'FD2022080310000055123451223', 0.01, '1', '002197|公众号', 'A', 'ovIGQwOy1e-Zptyug20l5hqI0P5Q', 'https://www.baidu.com'); $mockHandler = new CreateOrderHandler(true); $response = Factory::pay($this->getConfig())->official->setMockHandler([$mockHandler])->jsapi($order); $this->assertArrayHasKey('response', $response); $this->assertEquals([ 'appId', 'timeStamp', 'nonceStr', 'package', 'signType', 'paySign', 'merchantId', 'merchantName', 'channelId', 'channelName' ], array_keys($response['response'])); } }