mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-29 12:41:10 -04:00
solve unit tests
This commit is contained in:
@ -10,8 +10,6 @@ use Illuminate\Support\Facades\Artisan;
|
||||
beforeEach(function () {
|
||||
Artisan::call('db:seed', ['--class' => 'DatabaseSeeder', '--force' => true]);
|
||||
Artisan::call('db:seed', ['--class' => 'DemoSeeder', '--force' => true]);
|
||||
Artisan::call('db:seed', ['--class' => 'UnitSeeder', '--force' => true]);
|
||||
Artisan::call('db:seed', ['--class' => 'PaymentMethodSeeder', '--force' => true]);
|
||||
});
|
||||
|
||||
test('invoice has many invoice items', function () {
|
||||
@ -114,7 +112,7 @@ test('update invoice', function () {
|
||||
array_push($newInvoice['items'], $item);
|
||||
array_push($newInvoice['taxes'], $tax);
|
||||
|
||||
$request = new Request();
|
||||
$request = new InvoicesRequest();
|
||||
|
||||
$request->replace($newInvoice);
|
||||
|
||||
@ -161,7 +159,7 @@ test('create items', function () {
|
||||
|
||||
$request->replace(['items' => $items ]);
|
||||
|
||||
Invoice::createItems($invoice, $request, $invoice->exchange_rate);
|
||||
Invoice::createItems($invoice, $request->items);
|
||||
|
||||
$this->assertDatabaseHas('invoice_items', [
|
||||
'invoice_id' => $invoice->id,
|
||||
@ -188,7 +186,7 @@ test('create taxes', function () {
|
||||
|
||||
$request->replace(['taxes' => $taxes ]);
|
||||
|
||||
Invoice::createTaxes($invoice, $request, $invoice->exchange_rate);
|
||||
Invoice::createTaxes($invoice, $request->taxes);
|
||||
|
||||
$this->assertDatabaseHas('taxes', [
|
||||
'invoice_id' => $invoice->id,
|
||||
|
||||
Reference in New Issue
Block a user