public function testPurchase() { /** * @var AopTradePreCreateResponse $response */ $response = $this->gateway->purchase(['biz_content' => ['out_trade_no' => date('YmdHis') . mt_rand(1000, 9999), 'subject' => 'test', 'total_amount' => '0.01']])->send(); $this->assertArrayHasKey('alipay_trade_precreate_response', $response->getData()); $this->assertFalse($response->isSuccessful()); $this->assertFalse($response->isRedirect()); }