Setup pint & run code style fix

This commit is contained in:
gdarko
2024-01-29 04:46:01 -06:00
parent 8de34efd8c
commit 4ab92473e9
406 changed files with 1616 additions and 2026 deletions

View File

@@ -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 () {

View File

@@ -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)

View File

@@ -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}")

View File

@@ -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();

View File

@@ -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();

View File

@@ -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'],
]);
});