public function setUp() { parent::setUp(); // создаём счёт Bill::truncate(); $bill = new Bill(); $bill->create(array('merchant_id' => 1, 'bill_id' => '1q2w3e', 'user' => 'tel:+7123', 'amount' => 123.45, 'ccy' => 'RUB', 'comment' => 'test', 'status' => 'paid')); // создаём возврат оплаты по счёту Refund::truncate(); $refund = new Refund(); $refund->create(array('bill_id' => 1, 'refund_id' => '456', 'amount' => 123.45, 'status' => 'processing')); }
/** * @return Illuminate\Http\JsonResponse */ public function testRefundBillFailIdExist() { // создаём возврат оплаты по счёту Refund::truncate(); $refund = new Refund(); $refund->create(array('bill_id' => '1q2w3e', 'refund_id' => '456', 'amount' => 123.45, 'status' => 'processing')); $this->call('PUT', Config::get('ff-qiwi-gate::app.url') . '/qiwi/gate/api/v2/prv/1/bills/1q2w3e/refund/456', array('amount' => 50)); $oResponse = $this->response()->getData(); $this->assertEquals(215, $oResponse->response->result_code); $this->assertEquals(403, $this->client->getResponse()->getStatusCode()); }