mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-19 19:24:03 +00:00
Setup pint & run code style fix
This commit is contained in:
@@ -2,10 +2,11 @@
|
||||
|
||||
namespace Tests\Feature\Customer;
|
||||
|
||||
use InvoiceShelf\Models\Customer;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use InvoiceShelf\Models\Customer;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
|
||||
use function Pest\Laravel\getJson;
|
||||
|
||||
beforeEach(function () {
|
||||
|
||||
@@ -2,11 +2,12 @@
|
||||
|
||||
namespace Tests\Feature\Customer;
|
||||
|
||||
use InvoiceShelf\Models\Customer;
|
||||
use InvoiceShelf\Models\Estimate;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use InvoiceShelf\Models\Customer;
|
||||
use InvoiceShelf\Models\Estimate;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
|
||||
use function Pest\Laravel\getJson;
|
||||
use function Pest\Laravel\postJson;
|
||||
|
||||
@@ -33,7 +34,7 @@ test('get customer estimate', function () {
|
||||
$customer = Auth::guard('customer')->user();
|
||||
|
||||
$estimate = Estimate::factory()->create([
|
||||
'customer_id' => $customer->id
|
||||
'customer_id' => $customer->id,
|
||||
]);
|
||||
|
||||
getJson("/api/v1/{$customer->company->slug}/customer/estimates/{$estimate->id}")
|
||||
@@ -46,11 +47,11 @@ test('customer estimate mark as accepted', function () {
|
||||
$estimate = Estimate::factory()->create([
|
||||
'estimate_date' => '1988-07-18',
|
||||
'expiry_date' => '1988-08-18',
|
||||
'customer_id' => $customer->id
|
||||
'customer_id' => $customer->id,
|
||||
]);
|
||||
|
||||
$status = [
|
||||
'status' => Estimate::STATUS_ACCEPTED
|
||||
'status' => Estimate::STATUS_ACCEPTED,
|
||||
];
|
||||
|
||||
$response = postJson("api/v1/{$customer->company->slug}/customer/estimate/{$estimate->id}/status", $status)
|
||||
@@ -65,11 +66,11 @@ test('customer estimate mark as rejected', function () {
|
||||
$estimate = Estimate::factory()->create([
|
||||
'estimate_date' => '1988-07-18',
|
||||
'expiry_date' => '1988-08-18',
|
||||
'customer_id' => $customer->id
|
||||
'customer_id' => $customer->id,
|
||||
]);
|
||||
|
||||
$status = [
|
||||
'status' => Estimate::STATUS_REJECTED
|
||||
'status' => Estimate::STATUS_REJECTED,
|
||||
];
|
||||
|
||||
$response = postJson("api/v1/{$customer->company->slug}/customer/estimate/{$estimate->id}/status", $status)
|
||||
|
||||
@@ -2,11 +2,12 @@
|
||||
|
||||
namespace Tests\Feature\Customer;
|
||||
|
||||
use InvoiceShelf\Models\Customer;
|
||||
use InvoiceShelf\Models\Expense;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use InvoiceShelf\Models\Customer;
|
||||
use InvoiceShelf\Models\Expense;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
|
||||
use function Pest\Laravel\getJson;
|
||||
|
||||
beforeEach(function () {
|
||||
@@ -33,7 +34,7 @@ test('get customer expense', function () {
|
||||
|
||||
$expense = Expense::factory()->create([
|
||||
'customer_id' => $customer->id,
|
||||
'company_id' => $customer->company->id
|
||||
'company_id' => $customer->company->id,
|
||||
]);
|
||||
|
||||
getJson("/api/v1/{$customer->company->slug}/customer/expenses/{$expense->id}")
|
||||
|
||||
@@ -2,11 +2,12 @@
|
||||
|
||||
namespace Tests\Feature\Customer;
|
||||
|
||||
use InvoiceShelf\Models\Customer;
|
||||
use InvoiceShelf\Models\Invoice;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use InvoiceShelf\Models\Customer;
|
||||
use InvoiceShelf\Models\Invoice;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
|
||||
use function Pest\Laravel\getJson;
|
||||
|
||||
beforeEach(function () {
|
||||
@@ -32,7 +33,7 @@ test('get customer invoice', function () {
|
||||
$customer = Auth::guard('customer')->user();
|
||||
|
||||
$invoice = Invoice::factory()->create([
|
||||
'customer_id' => $customer->id
|
||||
'customer_id' => $customer->id,
|
||||
]);
|
||||
|
||||
getJson("/api/v1/{$customer->company->slug}/customer/invoices/{$invoice->id}")->assertOk();
|
||||
|
||||
@@ -2,11 +2,12 @@
|
||||
|
||||
namespace Tests\Feature\Customer;
|
||||
|
||||
use InvoiceShelf\Models\Customer;
|
||||
use InvoiceShelf\Models\Payment;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use InvoiceShelf\Models\Customer;
|
||||
use InvoiceShelf\Models\Payment;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
|
||||
use function Pest\Laravel\getJson;
|
||||
|
||||
beforeEach(function () {
|
||||
@@ -32,7 +33,7 @@ test('get customer payment', function () {
|
||||
$customer = Auth::guard('customer')->user();
|
||||
|
||||
$payment = Payment::factory()->create([
|
||||
'customer_id' => $customer->id
|
||||
'customer_id' => $customer->id,
|
||||
]);
|
||||
|
||||
getJson("/api/v1/{$customer->company->slug}/customer/payments/{$payment->id}")->assertOk();
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
|
||||
namespace Tests\Feature\Customer;
|
||||
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use InvoiceShelf\Http\Controllers\V1\Customer\General\ProfileController;
|
||||
use InvoiceShelf\Http\Requests\Customer\CustomerProfileRequest;
|
||||
use InvoiceShelf\Models\Customer;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
|
||||
use function Pest\Laravel\getJson;
|
||||
use function Pest\Laravel\postJson;
|
||||
|
||||
@@ -38,19 +39,19 @@ test('update customer profile', function () {
|
||||
$newCustomer = Customer::factory()->raw([
|
||||
'shipping' => [
|
||||
'name' => 'newName',
|
||||
'address_street_1' => 'address'
|
||||
'address_street_1' => 'address',
|
||||
],
|
||||
'billing' => [
|
||||
'name' => 'newName',
|
||||
'address_street_1' => 'address'
|
||||
]
|
||||
'address_street_1' => 'address',
|
||||
],
|
||||
]);
|
||||
|
||||
postJson("api/v1/{$customer->company->slug}/customer/profile", $newCustomer)->assertOk();
|
||||
|
||||
$this->assertDatabaseHas('customers', [
|
||||
'name' => $customer['name'],
|
||||
'email' => $customer['email']
|
||||
'email' => $customer['email'],
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user