mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-08-05 11:10:16 -04:00
Fixes for tests
This commit is contained in:
parent
bd406136d6
commit
e1ec2928a9
@ -70,8 +70,8 @@ class RefundPaymentRequest extends Request
|
|||||||
'id' => ['bail','required', new ValidRefundableRequest($input)],
|
'id' => ['bail','required', new ValidRefundableRequest($input)],
|
||||||
'amount' => ['numeric', 'max:99999999999999'],
|
'amount' => ['numeric', 'max:99999999999999'],
|
||||||
'date' => 'required',
|
'date' => 'required',
|
||||||
'invoices.*.invoice_id' => 'required',
|
'invoices.*.invoice_id' => 'required|bail',
|
||||||
'invoices.*.amount' => 'required',
|
'invoices.*.amount' => 'required|bail|gt:0',
|
||||||
'invoices' => new ValidRefundableInvoices($input),
|
'invoices' => new ValidRefundableInvoices($input),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -173,7 +173,7 @@ class InvoiceAmountPaymentTest extends TestCase
|
|||||||
$response = $this->withHeaders([
|
$response = $this->withHeaders([
|
||||||
'X-API-SECRET' => config('ninja.api_secret'),
|
'X-API-SECRET' => config('ninja.api_secret'),
|
||||||
'X-API-TOKEN' => $this->token,
|
'X-API-TOKEN' => $this->token,
|
||||||
])->post('/api/v1/invoices?mark_sent=true', $invoice)
|
])->postJson('/api/v1/invoices?mark_sent=true', $invoice)
|
||||||
->assertStatus(200);
|
->assertStatus(200);
|
||||||
|
|
||||||
$arr = $response->json();
|
$arr = $response->json();
|
||||||
@ -182,6 +182,17 @@ class InvoiceAmountPaymentTest extends TestCase
|
|||||||
|
|
||||||
$invoice = Invoice::find($this->decodePrimaryKey($invoice_one_hashed_id));
|
$invoice = Invoice::find($this->decodePrimaryKey($invoice_one_hashed_id));
|
||||||
|
|
||||||
|
$line_items = (array)$invoice->line_items;
|
||||||
|
$item = InvoiceItemFactory::create();
|
||||||
|
$item->quantity = 1;
|
||||||
|
$item->cost = 5;
|
||||||
|
$item->type_id = '3';
|
||||||
|
|
||||||
|
$line_items[] = $item;
|
||||||
|
|
||||||
|
$invoice->line_items = $line_items;
|
||||||
|
$invoice->calc()->getInvoice();
|
||||||
|
|
||||||
$this->assertEquals(25, $invoice->balance);
|
$this->assertEquals(25, $invoice->balance);
|
||||||
$this->assertEquals(25, $invoice->amount);
|
$this->assertEquals(25, $invoice->amount);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user