diff --git a/tests/Feature/Console/Commands/ScheduleNotificationReminderTest.php b/tests/Feature/Console/Commands/ScheduleNotificationReminderTest.php index c6e0f3e3..d37e434a 100755 --- a/tests/Feature/Console/Commands/ScheduleNotificationReminderTest.php +++ b/tests/Feature/Console/Commands/ScheduleNotificationReminderTest.php @@ -9,11 +9,12 @@ use App\Models\Lead; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Mail; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class ScheduleNotificationReminderTest extends TestCase { - /** @test */ + #[Test] public function it_can_send_notifications(): void { Mail::fake(); @@ -41,7 +42,7 @@ public function it_can_send_notifications(): void }); } - /** @test */ + #[Test] public function it_can_store_notifications(): void { $timezone = 'Europe/Madrid'; diff --git a/tests/Feature/Controllers/Api/Auth/LoginControllerTest.php b/tests/Feature/Controllers/Api/Auth/LoginControllerTest.php index 72edb080..304d37da 100755 --- a/tests/Feature/Controllers/Api/Auth/LoginControllerTest.php +++ b/tests/Feature/Controllers/Api/Auth/LoginControllerTest.php @@ -4,11 +4,14 @@ namespace Tests\Feature\Controllers\Api\Auth; +use PHPUnit\Framework\Attributes\CoversMethod; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class LoginControllerTest extends TestCase { - /** @test */ + #[Test] + //#[CoversMethod('App\Http\Controllers\Api\Auth\LoginController', 'login')] public function it_can_login() { $credentials = ['email' => $this->user->email, 'password' => 'password']; @@ -23,7 +26,7 @@ public function it_can_login() $this->isAuthenticated('api'); } - /** @test */ + #[Test] public function it_can_not_login_with_wrong_credentials() { $credentials = ['email' => $this->user->email, 'password' => 'wrong_password']; @@ -36,7 +39,7 @@ public function it_can_not_login_with_wrong_credentials() $this->assertGuest('api'); } - /** @test */ + #[Test] public function it_can_get_credentials() { $this->actingAs($this->user, 'api'); @@ -48,7 +51,7 @@ public function it_can_get_credentials() ->assertExactJson($this->user->toArray()); } - /** @test */ + #[Test] public function it_can_logout() { $credentials = ['email' => $this->user->email, 'password' => 'password']; @@ -64,7 +67,7 @@ public function it_can_logout() $this->assertGuest('api'); } - /** @test */ + #[Test] public function it_can_refresh_token() { $credentials = ['email' => $this->user->email, 'password' => 'password']; diff --git a/tests/Feature/Controllers/Api/Contact/ContactCreateControllerTest.php b/tests/Feature/Controllers/Api/Contact/ContactCreateControllerTest.php index 0eab8721..6824a0fe 100755 --- a/tests/Feature/Controllers/Api/Contact/ContactCreateControllerTest.php +++ b/tests/Feature/Controllers/Api/Contact/ContactCreateControllerTest.php @@ -6,17 +6,16 @@ use App\Models\Industry; use App\Models\Lead; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class ContactCreateControllerTest extends TestCase { - protected $jsonStructureContact = [ + protected array $jsonStructureContact = [ 'id', ]; - /** - * @test - */ + #[Test] public function can_create_contact(): void { $this->actingAs($this->user, 'api'); @@ -60,9 +59,7 @@ public function can_create_contact(): void ->assertSee($data['contact_phone']); } - /** - * @test - */ + #[Test] public function create_contact_have_missing_parameters(): void { $this->actingAs($this->user, 'api'); diff --git a/tests/Feature/Controllers/Api/Customer/CustomerCreateControllerTest.php b/tests/Feature/Controllers/Api/Customer/CustomerCreateControllerTest.php index 391c02a7..9cf5e9e8 100755 --- a/tests/Feature/Controllers/Api/Customer/CustomerCreateControllerTest.php +++ b/tests/Feature/Controllers/Api/Customer/CustomerCreateControllerTest.php @@ -4,11 +4,12 @@ use App\Models\Customer; use App\Models\User; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class CustomerCreateControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_save_customer(): void { $this->actingAs(User::factory()->create(), 'api'); diff --git a/tests/Feature/Controllers/Api/Customer/CustomerListControllerTest.php b/tests/Feature/Controllers/Api/Customer/CustomerListControllerTest.php index 26668274..03fc99cb 100755 --- a/tests/Feature/Controllers/Api/Customer/CustomerListControllerTest.php +++ b/tests/Feature/Controllers/Api/Customer/CustomerListControllerTest.php @@ -4,11 +4,12 @@ use App\Models\Customer; use App\Models\User; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class CustomerListControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_list_customer(): void { $this->actingAs(User::factory()->create(), 'api'); diff --git a/tests/Feature/Controllers/Api/Customer/CustomerReadControllerTest.php b/tests/Feature/Controllers/Api/Customer/CustomerReadControllerTest.php index 4a0dcb3e..886ee57a 100755 --- a/tests/Feature/Controllers/Api/Customer/CustomerReadControllerTest.php +++ b/tests/Feature/Controllers/Api/Customer/CustomerReadControllerTest.php @@ -4,11 +4,12 @@ use App\Models\Customer; use App\Models\User; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class CustomerReadControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_read_customer(): void { $this->actingAs(User::factory()->create(), 'api'); @@ -19,7 +20,7 @@ public function it_can_read_customer(): void $this->assertEquals(array_except($response->json()['customer'], ['seller', 'industry', 'country']), $customer->toArray()); } - /** @test */ + #[Test] public function it_not_found_a_customer(): void { $this->actingAs(User::factory()->create(), 'api'); diff --git a/tests/Feature/Controllers/Api/Customer/CustomerUpdateControllerTest.php b/tests/Feature/Controllers/Api/Customer/CustomerUpdateControllerTest.php index 6b6b6095..d36b8e28 100755 --- a/tests/Feature/Controllers/Api/Customer/CustomerUpdateControllerTest.php +++ b/tests/Feature/Controllers/Api/Customer/CustomerUpdateControllerTest.php @@ -1,14 +1,17 @@ actingAs(User::factory()->create(), 'api'); diff --git a/tests/Feature/Controllers/Api/Lead/LeadCreateControllerTest.php b/tests/Feature/Controllers/Api/Lead/LeadCreateControllerTest.php index 0fbf0c37..32d73740 100755 --- a/tests/Feature/Controllers/Api/Lead/LeadCreateControllerTest.php +++ b/tests/Feature/Controllers/Api/Lead/LeadCreateControllerTest.php @@ -4,11 +4,12 @@ use App\Models\Lead; use App\Models\User; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class LeadCreateControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_save_lead(): void { $this->actingAs(User::factory()->create(), 'api'); diff --git a/tests/Feature/Controllers/Api/Lead/LeadListControllerTest.php b/tests/Feature/Controllers/Api/Lead/LeadListControllerTest.php index 8401e4a4..1a6f6eef 100755 --- a/tests/Feature/Controllers/Api/Lead/LeadListControllerTest.php +++ b/tests/Feature/Controllers/Api/Lead/LeadListControllerTest.php @@ -4,11 +4,12 @@ use App\Models\Lead; use App\Models\User; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class LeadListControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_list_lead(): void { $this->actingAs(User::factory()->create(), 'api'); diff --git a/tests/Feature/Controllers/Api/Lead/LeadReadControllerTest.php b/tests/Feature/Controllers/Api/Lead/LeadReadControllerTest.php index 6c61d7b6..f69a96c6 100755 --- a/tests/Feature/Controllers/Api/Lead/LeadReadControllerTest.php +++ b/tests/Feature/Controllers/Api/Lead/LeadReadControllerTest.php @@ -4,11 +4,12 @@ use App\Models\Lead; use App\Models\User; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class LeadReadControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_read_lead(): void { $this->actingAs(User::factory()->create(), 'api'); @@ -19,7 +20,7 @@ public function it_can_read_lead(): void $this->assertEquals(array_except($response->json()['lead'], ['seller', 'industry', 'country', 'company']), $lead->toArray()); } - /** @test */ + #[Test] public function it_not_found_a_lead(): void { $this->actingAs(User::factory()->create(), 'api'); diff --git a/tests/Feature/Controllers/Api/Lead/LeadUpdateControllerTest.php b/tests/Feature/Controllers/Api/Lead/LeadUpdateControllerTest.php index 4fbbc6f9..26040e6a 100755 --- a/tests/Feature/Controllers/Api/Lead/LeadUpdateControllerTest.php +++ b/tests/Feature/Controllers/Api/Lead/LeadUpdateControllerTest.php @@ -4,11 +4,12 @@ use App\Models\Lead; use App\Models\User; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class LeadUpdateControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_update_lead(): void { $this->actingAs(User::factory()->create(), 'api'); diff --git a/tests/Feature/Controllers/Bank/BankCreateControllerTest.php b/tests/Feature/Controllers/Bank/BankCreateControllerTest.php index 63c4dadb..e614b94a 100755 --- a/tests/Feature/Controllers/Bank/BankCreateControllerTest.php +++ b/tests/Feature/Controllers/Bank/BankCreateControllerTest.php @@ -2,11 +2,12 @@ namespace Tests\Feature\Controllers\Bank; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class BankCreateControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_create_bank() { $response = $this->get('/bank/create'); diff --git a/tests/Feature/Controllers/Bank/BankIndexControllerTest.php b/tests/Feature/Controllers/Bank/BankIndexControllerTest.php index 5b264780..84bb0870 100755 --- a/tests/Feature/Controllers/Bank/BankIndexControllerTest.php +++ b/tests/Feature/Controllers/Bank/BankIndexControllerTest.php @@ -3,11 +3,12 @@ namespace Tests\Feature\Controllers\Bank; use App\Models\Bank; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class BankIndexControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_index_bank() { $banks = Bank::factory()->count(2)->create(); diff --git a/tests/Feature/Controllers/Bank/BankSaveControllerTest.php b/tests/Feature/Controllers/Bank/BankSaveControllerTest.php index 0a1c971b..c79152df 100755 --- a/tests/Feature/Controllers/Bank/BankSaveControllerTest.php +++ b/tests/Feature/Controllers/Bank/BankSaveControllerTest.php @@ -3,11 +3,12 @@ namespace Tests\Feature\Controllers\Bank; use App\Models\Bank; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class BankSaveControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_save_bank(): void { $data = Bank::factory()->create()->toArray(); @@ -18,7 +19,7 @@ public function it_can_save_bank(): void $this->equalTo(Bank::all()->last(), $data); } - /** @test */ + #[Test] public function it_can_update_bank(): void { $data = Bank::factory()->create()->toArray(); diff --git a/tests/Feature/Controllers/Bank/BankUpdateControllerTest.php b/tests/Feature/Controllers/Bank/BankUpdateControllerTest.php index dfa37eb8..f253af91 100755 --- a/tests/Feature/Controllers/Bank/BankUpdateControllerTest.php +++ b/tests/Feature/Controllers/Bank/BankUpdateControllerTest.php @@ -3,11 +3,12 @@ namespace Tests\Feature\Controllers\Bank; use App\Models\Bank; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class BankUpdateControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_update_bank(): void { $bank = Bank::factory()->create(); diff --git a/tests/Feature/Controllers/Brand/BrandCreateControllerTest.php b/tests/Feature/Controllers/Brand/BrandCreateControllerTest.php index 8049c448..27a73d82 100755 --- a/tests/Feature/Controllers/Brand/BrandCreateControllerTest.php +++ b/tests/Feature/Controllers/Brand/BrandCreateControllerTest.php @@ -2,11 +2,12 @@ namespace Tests\Feature\Controllers\Brand; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class BrandCreateControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_create_brand() { $response = $this->get('/brand/create'); diff --git a/tests/Feature/Controllers/Brand/BrandDeleteControllerTest.php b/tests/Feature/Controllers/Brand/BrandDeleteControllerTest.php index 99bca1a5..6f9de75a 100755 --- a/tests/Feature/Controllers/Brand/BrandDeleteControllerTest.php +++ b/tests/Feature/Controllers/Brand/BrandDeleteControllerTest.php @@ -3,11 +3,12 @@ namespace Tests\Feature\Controllers\Brand; use App\Models\Brand; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class BrandDeleteControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_delete_brand() { $brand = Brand::factory()->create(); diff --git a/tests/Feature/Controllers/Brand/BrandIndexControllerTest.php b/tests/Feature/Controllers/Brand/BrandIndexControllerTest.php index fb5ca64f..d4cb3f66 100755 --- a/tests/Feature/Controllers/Brand/BrandIndexControllerTest.php +++ b/tests/Feature/Controllers/Brand/BrandIndexControllerTest.php @@ -3,11 +3,12 @@ namespace Tests\Feature\Controllers\Brand; use App\Models\Brand; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class BrandIndexControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_index_brand() { $brands = Brand::factory()->count(2)->create(['company_id' => $this->user->company_id]); diff --git a/tests/Feature/Controllers/Brand/BrandSaveControllerTest.php b/tests/Feature/Controllers/Brand/BrandSaveControllerTest.php index b1cbeb3b..1b9bf990 100755 --- a/tests/Feature/Controllers/Brand/BrandSaveControllerTest.php +++ b/tests/Feature/Controllers/Brand/BrandSaveControllerTest.php @@ -3,11 +3,12 @@ namespace Tests\Feature\Controllers\Brand; use App\Models\Brand; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class BrandSaveControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_save_brand(): void { $data = Brand::factory()->create(['company_id' => $this->user->company_id])->toArray(); @@ -18,7 +19,7 @@ public function it_can_save_brand(): void $this->equalTo(Brand::all()->last(), $data); } - /** @test */ + #[Test] public function it_can_update_brand(): void { $data = Brand::factory()->create(['company_id' => $this->user->company_id])->toArray(); diff --git a/tests/Feature/Controllers/Brand/BrandUpdateControllerTest.php b/tests/Feature/Controllers/Brand/BrandUpdateControllerTest.php index 1ee5e12f..0bf90ab8 100755 --- a/tests/Feature/Controllers/Brand/BrandUpdateControllerTest.php +++ b/tests/Feature/Controllers/Brand/BrandUpdateControllerTest.php @@ -3,11 +3,12 @@ namespace Tests\Feature\Controllers\Brand; use App\Models\Brand; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class BrandUpdateControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_update_brand(): void { $brand = Brand::factory()->create(); diff --git a/tests/Feature/Controllers/Company/CompanyCreateControllerTest.php b/tests/Feature/Controllers/Company/CompanyCreateControllerTest.php index 7750fb3a..40d7f265 100755 --- a/tests/Feature/Controllers/Company/CompanyCreateControllerTest.php +++ b/tests/Feature/Controllers/Company/CompanyCreateControllerTest.php @@ -4,11 +4,12 @@ namespace Tests\Feature\Controllers\Company; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class CompanyCreateControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_create_company(): void { $response = $this->get('/company/create'); diff --git a/tests/Feature/Controllers/Company/CompanyDeleteControllerTest.php b/tests/Feature/Controllers/Company/CompanyDeleteControllerTest.php index 6c2a0268..22df3517 100755 --- a/tests/Feature/Controllers/Company/CompanyDeleteControllerTest.php +++ b/tests/Feature/Controllers/Company/CompanyDeleteControllerTest.php @@ -5,11 +5,12 @@ namespace Tests\Feature\Controllers\Company; use App\Models\Company; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class CompanyDeleteControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_delete_company(): void { $company = Company::factory()->create(); diff --git a/tests/Feature/Controllers/Company/CompanyIndexControllerTest.php b/tests/Feature/Controllers/Company/CompanyIndexControllerTest.php index bf3993b2..ab89ba95 100755 --- a/tests/Feature/Controllers/Company/CompanyIndexControllerTest.php +++ b/tests/Feature/Controllers/Company/CompanyIndexControllerTest.php @@ -5,11 +5,12 @@ namespace Tests\Feature\Controllers\Company; use App\Models\Company; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class CompanyIndexControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_get_index_company(): void { $this->withoutExceptionHandling(); diff --git a/tests/Feature/Controllers/Company/CompanySaveControllerTest.php b/tests/Feature/Controllers/Company/CompanySaveControllerTest.php index 36e81814..a5513e61 100755 --- a/tests/Feature/Controllers/Company/CompanySaveControllerTest.php +++ b/tests/Feature/Controllers/Company/CompanySaveControllerTest.php @@ -8,11 +8,12 @@ use Illuminate\Http\UploadedFile; use Illuminate\Support\Facades\File; use Illuminate\Support\Str; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class CompanySaveControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_save_company(): void { $data = [ diff --git a/tests/Feature/Controllers/Company/CompanyUpdateControllerTest.php b/tests/Feature/Controllers/Company/CompanyUpdateControllerTest.php index 9c7e6866..ecc4dd46 100755 --- a/tests/Feature/Controllers/Company/CompanyUpdateControllerTest.php +++ b/tests/Feature/Controllers/Company/CompanyUpdateControllerTest.php @@ -5,11 +5,12 @@ namespace Tests\Feature\Controllers\Company; use App\Models\Company; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class CompanyUpdateControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_update_company(): void { $company = Company::factory()->create(); diff --git a/tests/Feature/Controllers/Customer/CustomerCreateControllerTest.php b/tests/Feature/Controllers/Customer/CustomerCreateControllerTest.php index eff6df6e..94178a5b 100755 --- a/tests/Feature/Controllers/Customer/CustomerCreateControllerTest.php +++ b/tests/Feature/Controllers/Customer/CustomerCreateControllerTest.php @@ -4,11 +4,12 @@ namespace Tests\Feature\Controllers\Customer; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class CustomerCreateControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_create_customer(): void { $response = $this->get('/customer/create'); diff --git a/tests/Feature/Controllers/Customer/CustomerDeleteControllerTest.php b/tests/Feature/Controllers/Customer/CustomerDeleteControllerTest.php index 6d6ea4be..f5bd72e8 100755 --- a/tests/Feature/Controllers/Customer/CustomerDeleteControllerTest.php +++ b/tests/Feature/Controllers/Customer/CustomerDeleteControllerTest.php @@ -5,11 +5,12 @@ namespace Tests\Feature\Controllers\Customer; use App\Models\Customer; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class CustomerDeleteControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_delete_customer(): void { $customer = Customer::factory()->create(); diff --git a/tests/Feature/Controllers/Customer/CustomerExportControllerTest.php b/tests/Feature/Controllers/Customer/CustomerExportControllerTest.php index 0d6a944d..d0eb86c3 100755 --- a/tests/Feature/Controllers/Customer/CustomerExportControllerTest.php +++ b/tests/Feature/Controllers/Customer/CustomerExportControllerTest.php @@ -4,11 +4,12 @@ use App\Models\Customer; use Illuminate\Support\Facades\Storage; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class CustomerExportControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_export_customer_to_csv() { Customer::factory() diff --git a/tests/Feature/Controllers/Customer/CustomerImportIndexControllerTest.php b/tests/Feature/Controllers/Customer/CustomerImportIndexControllerTest.php index 999841fc..c6638488 100755 --- a/tests/Feature/Controllers/Customer/CustomerImportIndexControllerTest.php +++ b/tests/Feature/Controllers/Customer/CustomerImportIndexControllerTest.php @@ -4,11 +4,12 @@ namespace Tests\Feature\Controllers\Customer; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class CustomerImportIndexControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_index_import_customer(): void { $response = $this->get('/customer/import'); diff --git a/tests/Feature/Controllers/Customer/CustomerImportSaveControllerTest.php b/tests/Feature/Controllers/Customer/CustomerImportSaveControllerTest.php index f319cc52..73ecdf53 100755 --- a/tests/Feature/Controllers/Customer/CustomerImportSaveControllerTest.php +++ b/tests/Feature/Controllers/Customer/CustomerImportSaveControllerTest.php @@ -6,11 +6,12 @@ use App\Models\Customer; use Illuminate\Http\UploadedFile; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class CustomerImportSaveControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_import_customers_from_csv() { $response = $this->post('customer/import/save', []); diff --git a/tests/Feature/Controllers/Customer/CustomerIndexControllerTest.php b/tests/Feature/Controllers/Customer/CustomerIndexControllerTest.php index 1cf5bff7..cfcf5beb 100755 --- a/tests/Feature/Controllers/Customer/CustomerIndexControllerTest.php +++ b/tests/Feature/Controllers/Customer/CustomerIndexControllerTest.php @@ -3,11 +3,12 @@ namespace Tests\Feature\Controllers\Customer; use App\Models\Customer; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class CustomerIndexControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_view_index_customers() { $customer = Customer::factory()->create(['company_id' => $this->user->company_id, 'status' => Customer::OPEN]); diff --git a/tests/Feature/Controllers/Customer/CustomerSaveControllerTest.php b/tests/Feature/Controllers/Customer/CustomerSaveControllerTest.php index e6a74301..efde560a 100755 --- a/tests/Feature/Controllers/Customer/CustomerSaveControllerTest.php +++ b/tests/Feature/Controllers/Customer/CustomerSaveControllerTest.php @@ -5,11 +5,12 @@ namespace Tests\Feature\Controllers\Customer; use App\Models\Customer; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class CustomerSaveControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_save_customer(): void { $data = Customer::factory()->create()->toArray(); @@ -21,7 +22,7 @@ public function it_can_save_customer(): void $this->equalTo(Customer::all()->last(), $data); } - /** @test */ + #[Test] public function it_can_update_customer(): void { $data = Customer::factory()->create()->toArray(); diff --git a/tests/Feature/Controllers/Customer/CustomerShowControllerTest.php b/tests/Feature/Controllers/Customer/CustomerShowControllerTest.php index c9253144..8dda80d6 100755 --- a/tests/Feature/Controllers/Customer/CustomerShowControllerTest.php +++ b/tests/Feature/Controllers/Customer/CustomerShowControllerTest.php @@ -5,11 +5,12 @@ namespace Tests\Feature\Controllers\Customer; use App\Models\Customer; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class CustomerShowControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_show_customer(): void { $customer = Customer::factory()->create(); diff --git a/tests/Feature/Controllers/Email/EmailCreateControllerTest.php b/tests/Feature/Controllers/Email/EmailCreateControllerTest.php index 3241d467..5c7a5630 100755 --- a/tests/Feature/Controllers/Email/EmailCreateControllerTest.php +++ b/tests/Feature/Controllers/Email/EmailCreateControllerTest.php @@ -4,11 +4,12 @@ namespace Tests\Feature\Controllers\Email; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class EmailCreateControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_create_email(): void { $response = $this->get('/email/create'); diff --git a/tests/Feature/Controllers/Email/EmailDeleteControllerTest.php b/tests/Feature/Controllers/Email/EmailDeleteControllerTest.php index 64a45528..85975aaa 100755 --- a/tests/Feature/Controllers/Email/EmailDeleteControllerTest.php +++ b/tests/Feature/Controllers/Email/EmailDeleteControllerTest.php @@ -5,11 +5,12 @@ namespace Tests\Feature\Controllers\Email; use App\Models\Email; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class EmailDeleteControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_delete_email(): void { $email = Email::factory()->create(['company_id' => $this->user->company_id]); diff --git a/tests/Feature/Controllers/Email/EmailDuplicateControllerTest.php b/tests/Feature/Controllers/Email/EmailDuplicateControllerTest.php index f18000c4..0c84928c 100755 --- a/tests/Feature/Controllers/Email/EmailDuplicateControllerTest.php +++ b/tests/Feature/Controllers/Email/EmailDuplicateControllerTest.php @@ -5,11 +5,12 @@ namespace Tests\Feature\Controllers\Email; use App\Models\Email; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class EmailDuplicateControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_duplicate_email(): void { $email = Email::factory()->create(['status' => Email::DRAFT]); diff --git a/tests/Feature/Controllers/Email/EmailIndexControllerTest.php b/tests/Feature/Controllers/Email/EmailIndexControllerTest.php index 98300a97..a7a97393 100755 --- a/tests/Feature/Controllers/Email/EmailIndexControllerTest.php +++ b/tests/Feature/Controllers/Email/EmailIndexControllerTest.php @@ -4,11 +4,12 @@ use App\Models\Email; use App\Models\EmailTemplate; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class EmailIndexControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_show_emails_index() { EmailTemplate::factory()->create(); @@ -23,7 +24,7 @@ public function it_can_show_emails_index() $response->assertSee($email2->to); } - /** @test */ + #[Test] public function it_can_search_emails_index() { EmailTemplate::factory()->create(); diff --git a/tests/Feature/Controllers/Email/EmailSaveControllerTest.php b/tests/Feature/Controllers/Email/EmailSaveControllerTest.php index aff28d02..c25ec5b2 100755 --- a/tests/Feature/Controllers/Email/EmailSaveControllerTest.php +++ b/tests/Feature/Controllers/Email/EmailSaveControllerTest.php @@ -8,11 +8,12 @@ use App\Models\Email\Attach; use Illuminate\Http\UploadedFile; use Illuminate\Support\Facades\Storage; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class EmailSaveControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_save_email(): void { $data = [ @@ -28,7 +29,7 @@ public function it_can_save_email(): void $this->assertDatabaseHas('email', $data); } - /** @test */ + #[Test] public function it_can_save_email_with_attachment(): void { Storage::fake(); @@ -50,7 +51,7 @@ public function it_can_save_email_with_attachment(): void Storage::deleteDirectory('company'); } - /** @test */ + #[Test] public function it_can_update_email(): void { $email = Email::factory()->create(); diff --git a/tests/Feature/Controllers/Email/EmailSendControllerTest.php b/tests/Feature/Controllers/Email/EmailSendControllerTest.php index b47c0f87..8cabbf7c 100755 --- a/tests/Feature/Controllers/Email/EmailSendControllerTest.php +++ b/tests/Feature/Controllers/Email/EmailSendControllerTest.php @@ -7,11 +7,12 @@ use App\Mail\GenericEmail; use App\Models\Email; use Illuminate\Support\Facades\Mail; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class EmailSendControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_send_email(): void { Mail::fake(); diff --git a/tests/Feature/Controllers/Email/EmailUpdateControllerTest.php b/tests/Feature/Controllers/Email/EmailUpdateControllerTest.php index 02476c19..e8b99d46 100755 --- a/tests/Feature/Controllers/Email/EmailUpdateControllerTest.php +++ b/tests/Feature/Controllers/Email/EmailUpdateControllerTest.php @@ -5,11 +5,12 @@ namespace Tests\Feature\Controllers\Email; use App\Models\Email; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class EmailUpdateControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_update_email(): void { $email = Email::factory()->create(); diff --git a/tests/Feature/Controllers/Email/EmailViewControllerTest.php b/tests/Feature/Controllers/Email/EmailViewControllerTest.php index d83d9cf7..0f390dd6 100755 --- a/tests/Feature/Controllers/Email/EmailViewControllerTest.php +++ b/tests/Feature/Controllers/Email/EmailViewControllerTest.php @@ -5,11 +5,12 @@ namespace Tests\Feature\Controllers\Email; use App\Models\Email; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class EmailViewControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_show_email(): void { $email = Email::factory()->create(); diff --git a/tests/Feature/Controllers/Lead/LeadCreateControllerTest.php b/tests/Feature/Controllers/Lead/LeadCreateControllerTest.php index 152f1751..02595b1a 100755 --- a/tests/Feature/Controllers/Lead/LeadCreateControllerTest.php +++ b/tests/Feature/Controllers/Lead/LeadCreateControllerTest.php @@ -6,7 +6,7 @@ class LeadCreateControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_create_lead() { $response = $this->get('/lead/create'); diff --git a/tests/Feature/Controllers/Lead/LeadDeleteControllerTest.php b/tests/Feature/Controllers/Lead/LeadDeleteControllerTest.php index bd2e0708..4e38e8dd 100755 --- a/tests/Feature/Controllers/Lead/LeadDeleteControllerTest.php +++ b/tests/Feature/Controllers/Lead/LeadDeleteControllerTest.php @@ -7,7 +7,7 @@ class LeadDeleteControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_delete_lead() { $lead = Lead::factory()->create(); diff --git a/tests/Feature/Controllers/Lead/LeadExportControllerTest.php b/tests/Feature/Controllers/Lead/LeadExportControllerTest.php index bb370ff0..14327d6c 100755 --- a/tests/Feature/Controllers/Lead/LeadExportControllerTest.php +++ b/tests/Feature/Controllers/Lead/LeadExportControllerTest.php @@ -8,7 +8,7 @@ class LeadExportControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_export_lead_to_csv() { Lead::factory() diff --git a/tests/Feature/Controllers/Lead/LeadImportIndexControllerTest.php b/tests/Feature/Controllers/Lead/LeadImportIndexControllerTest.php index eda959f1..dea56aa2 100755 --- a/tests/Feature/Controllers/Lead/LeadImportIndexControllerTest.php +++ b/tests/Feature/Controllers/Lead/LeadImportIndexControllerTest.php @@ -8,7 +8,7 @@ class LeadImportIndexControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_index_import_lead(): void { $response = $this->get('/lead/import'); diff --git a/tests/Feature/Controllers/Lead/LeadImportSaveControllerTest.php b/tests/Feature/Controllers/Lead/LeadImportSaveControllerTest.php index 8269bcff..649409e2 100755 --- a/tests/Feature/Controllers/Lead/LeadImportSaveControllerTest.php +++ b/tests/Feature/Controllers/Lead/LeadImportSaveControllerTest.php @@ -8,7 +8,7 @@ class LeadImportSaveControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_import_leads_from_csv() { $response = $this->post('lead/import/save', []); diff --git a/tests/Feature/Controllers/Lead/LeadIndexControllerTest.php b/tests/Feature/Controllers/Lead/LeadIndexControllerTest.php index 1795b83f..41ad4c91 100755 --- a/tests/Feature/Controllers/Lead/LeadIndexControllerTest.php +++ b/tests/Feature/Controllers/Lead/LeadIndexControllerTest.php @@ -7,7 +7,7 @@ class LeadIndexControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_view_index_leads() { $lead = Lead::factory()->create(['company_id' => $this->user->company_id, 'status' => Lead::OPEN]); diff --git a/tests/Feature/Controllers/Lead/LeadPromoteCustomerControllerTest.php b/tests/Feature/Controllers/Lead/LeadPromoteCustomerControllerTest.php index 62db42d2..63d6e6ce 100755 --- a/tests/Feature/Controllers/Lead/LeadPromoteCustomerControllerTest.php +++ b/tests/Feature/Controllers/Lead/LeadPromoteCustomerControllerTest.php @@ -9,7 +9,7 @@ class LeadPromoteCustomerControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_promote_from_lead_to_customer() { $lead = Lead::factory()->create(['status' => 'open']); @@ -26,7 +26,7 @@ public function it_can_promote_from_lead_to_customer() $this->assertEquals(array_except($lead->toArray(), ['id', 'company']), array_except($customer->toArray(), ['id', 'company'])); } - /** @test */ + #[Test] public function it_can_promote_from_lead_to_customer_with_contacts() { $lead = Lead::factory()->has(Contact::factory()->count(2))->create(['status' => 'open']); diff --git a/tests/Feature/Controllers/Lead/LeadSaveControllerTest.php b/tests/Feature/Controllers/Lead/LeadSaveControllerTest.php index 5eda22b4..7810cfc6 100755 --- a/tests/Feature/Controllers/Lead/LeadSaveControllerTest.php +++ b/tests/Feature/Controllers/Lead/LeadSaveControllerTest.php @@ -9,7 +9,7 @@ class LeadSaveControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_save_lead(): void { $data = Lead::factory()->create()->toArray(); @@ -21,7 +21,7 @@ public function it_can_save_lead(): void $this->equalTo(Lead::all()->last(), $data); } - /** @test */ + #[Test] public function it_can_update_lead(): void { $data = Lead::factory()->create()->toArray(); diff --git a/tests/Feature/Controllers/Lead/LeadShowControllerTest.php b/tests/Feature/Controllers/Lead/LeadShowControllerTest.php index 7bf3690b..4751b081 100755 --- a/tests/Feature/Controllers/Lead/LeadShowControllerTest.php +++ b/tests/Feature/Controllers/Lead/LeadShowControllerTest.php @@ -9,7 +9,7 @@ class LeadShowControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_show_lead(): void { $lead = Lead::factory()->create(); diff --git a/tests/Feature/Controllers/Product/ProductImportSaveControllerTest.php b/tests/Feature/Controllers/Product/ProductImportSaveControllerTest.php index 82bce508..9937cae2 100755 --- a/tests/Feature/Controllers/Product/ProductImportSaveControllerTest.php +++ b/tests/Feature/Controllers/Product/ProductImportSaveControllerTest.php @@ -6,11 +6,12 @@ use App\Models\Category; use App\Models\Product; use Illuminate\Http\UploadedFile; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class ProductImportSaveControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_import_products_from_csv() { Category::create(['name' => 'category test', 'company_id' => $this->user->company_id]); @@ -21,7 +22,7 @@ public function it_can_import_products_from_csv() $response->assertSessionHasErrors(); $path = str_replace('\\', DIRECTORY_SEPARATOR, base_path('tests\Feature\Controllers\Product\hammer_product_example_20221206.csv')); - $file = new UploadedFile($path, 'hammer_product_example_20221206.csv'); + $file = new UploadedFile($path, 'prospero_product_example_20221206.csv'); $response = $this->post('product/import/save', ['upload' => $file]); $response->assertRedirect('/product'); diff --git a/tests/Feature/Controllers/Product/ProductSaveControllerTest.php b/tests/Feature/Controllers/Product/ProductSaveControllerTest.php index c49810dd..1d813e45 100755 --- a/tests/Feature/Controllers/Product/ProductSaveControllerTest.php +++ b/tests/Feature/Controllers/Product/ProductSaveControllerTest.php @@ -7,11 +7,12 @@ use App\Models\Product; use Carbon\Carbon; use Illuminate\Http\UploadedFile; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class ProductSaveControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_save_a_product(): void { $product = Product::factory()->make()->toArray(); diff --git a/tests/Feature/Controllers/Product/hammer_product_example_20221206.csv b/tests/Feature/Controllers/Product/prospero_product_example_20221206.csv similarity index 100% rename from tests/Feature/Controllers/Product/hammer_product_example_20221206.csv rename to tests/Feature/Controllers/Product/prospero_product_example_20221206.csv diff --git a/tests/Feature/Controllers/Profile/ProfileSaveControllerTest.php b/tests/Feature/Controllers/Profile/ProfileSaveControllerTest.php index e40c55f6..9f296dbd 100755 --- a/tests/Feature/Controllers/Profile/ProfileSaveControllerTest.php +++ b/tests/Feature/Controllers/Profile/ProfileSaveControllerTest.php @@ -3,18 +3,19 @@ namespace Tests\Feature\Controllers\Profile; use App\Models\User; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class ProfileSaveControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_not_save_profile_without_data() { $response = $this->post('profile/save', []); $response->assertSessionHasErrors(); } - /** @test */ + #[Test] public function it_can_save_profile() { $data = [ @@ -32,7 +33,7 @@ public function it_can_save_profile() $response->assertSee($data['email']); } - /** @test */ + #[Test] public function it_can_update_password() { $oldPassword = $this->user->password; diff --git a/tests/Feature/Controllers/Supplier/SupplierSaveControllerTest.php b/tests/Feature/Controllers/Supplier/SupplierSaveControllerTest.php index 63759438..600e6e2a 100755 --- a/tests/Feature/Controllers/Supplier/SupplierSaveControllerTest.php +++ b/tests/Feature/Controllers/Supplier/SupplierSaveControllerTest.php @@ -5,11 +5,12 @@ namespace Tests\Feature\Controllers\Supplier; use App\Models\Supplier; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class SupplierSaveControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_save_supplier(): void { $data = Supplier::factory()->create()->toArray(); @@ -20,7 +21,7 @@ public function it_can_save_supplier(): void $this->equalTo(Supplier::all()->last(), $data); } - /** @test */ + #[Test] public function it_can_update_supplier(): void { $data = Supplier::factory()->create()->toArray(); diff --git a/tests/Feature/Controllers/Ticket/TicketIndexControllerTest.php b/tests/Feature/Controllers/Ticket/TicketIndexControllerTest.php index 3d2dfca8..10fcfb53 100755 --- a/tests/Feature/Controllers/Ticket/TicketIndexControllerTest.php +++ b/tests/Feature/Controllers/Ticket/TicketIndexControllerTest.php @@ -5,11 +5,12 @@ namespace Tests\Feature\Controllers\Ticket; use App\Models\Ticket; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class TicketIndexControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_view_index_tickets(): void { $ticket = Ticket::factory()->create(['company_id' => $this->user->company_id]); @@ -22,7 +23,7 @@ public function it_can_view_index_tickets(): void $response->assertSee($ticket2->title); } - /** @test */ + #[Test] public function it_can_search_tickets(): void { $ticket = Ticket::factory()->create(['company_id' => $this->user->company_id]); diff --git a/tests/Feature/Controllers/Ticket/TicketSaveControllerTest.php b/tests/Feature/Controllers/Ticket/TicketSaveControllerTest.php index d1cda73b..da042fde 100755 --- a/tests/Feature/Controllers/Ticket/TicketSaveControllerTest.php +++ b/tests/Feature/Controllers/Ticket/TicketSaveControllerTest.php @@ -9,6 +9,7 @@ use App\Models\Ticket; use App\Models\User; use Illuminate\Support\Facades\Mail; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class TicketSaveControllerTest extends TestCase @@ -20,7 +21,7 @@ public function setUp(): void $this->actingAs(User::factory()->create()); } - /** @test */ + #[Test] public function it_can_save_ticket(): void { $data = [ @@ -37,7 +38,7 @@ public function it_can_save_ticket(): void $this->assertDatabaseHas('ticket', $data); } - /** @test */ + #[Test] public function it_can_send_an_email_when_the_ticket_status_is_updated(): void { Mail::fake(); @@ -63,7 +64,7 @@ public function it_can_send_an_email_when_the_ticket_status_is_updated(): void Mail::assertSent(TicketStateChanged::class); } - /** @test */ + #[Test] public function it_can_send_an_email_when_the_ticket_is_closed(): void { Mail::fake(); diff --git a/tests/Feature/Controllers/User/UserSaveControllerTest.php b/tests/Feature/Controllers/User/UserSaveControllerTest.php index 2f52d536..4072d011 100755 --- a/tests/Feature/Controllers/User/UserSaveControllerTest.php +++ b/tests/Feature/Controllers/User/UserSaveControllerTest.php @@ -2,11 +2,12 @@ namespace Tests\Feature\Controllers\User; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class UserSaveControllerTest extends TestCase { - /** @test */ + #[Test] public function it_can_save_a_user() { $response = $this->post('user/save', []); diff --git a/tests/Feature/Helpers/DomainTest.php b/tests/Feature/Helpers/DomainTest.php index f05808e1..e0ce05c1 100755 --- a/tests/Feature/Helpers/DomainTest.php +++ b/tests/Feature/Helpers/DomainTest.php @@ -3,11 +3,12 @@ namespace Tests\Feature\Helpers; use App\Helpers\Domain; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class DomainTest extends TestCase { - /** @test */ + #[Test] public function it_can_validate_a_domain() { $urlInvalid = ''; diff --git a/tests/Feature/Mail/EventCalendarEmailTest.php b/tests/Feature/Mail/EventCalendarEmailTest.php index 09ee33f6..125bd433 100755 --- a/tests/Feature/Mail/EventCalendarEmailTest.php +++ b/tests/Feature/Mail/EventCalendarEmailTest.php @@ -9,7 +9,7 @@ class EventCalendarEmailTest extends TestCase { - /** @test */ + #[Test] public function it_can_create_event_calendar_email(): void { Mail::fake(); diff --git a/tests/Feature/Models/CalendarTest.php b/tests/Feature/Models/CalendarTest.php index 4c7134fb..802b9131 100755 --- a/tests/Feature/Models/CalendarTest.php +++ b/tests/Feature/Models/CalendarTest.php @@ -8,7 +8,7 @@ class CalendarTest extends TestCase { - /** @test */ + #[Test] public function it_can_use_timezones() { $this->assertEquals(config('app.timezone'), $this->user->timezone); diff --git a/tests/Unit/Helpers/PredictEmailTest.php b/tests/Unit/Helpers/PredictEmailTest.php index cffebd19..406b12ca 100755 --- a/tests/Unit/Helpers/PredictEmailTest.php +++ b/tests/Unit/Helpers/PredictEmailTest.php @@ -6,11 +6,12 @@ use App\Helpers\PredictEmail; use Illuminate\Support\Facades\Validator; +use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; class PredictEmailTest extends TestCase { - /** @test */ + #[Test] public function full_name_with_dots() { $predictEmail = new PredictEmail; @@ -18,7 +19,7 @@ public function full_name_with_dots() $this->assertEquals('john.doe@example.com', $email); } - /** @test */ + #[Test] public function first_letter_name_last_name() { $predictEmail = new PredictEmail; @@ -26,7 +27,7 @@ public function first_letter_name_last_name() $this->assertEquals('jdoe@example.com', $email); } - /** @test */ + #[Test] public function name_only() { $predictEmail = new PredictEmail; @@ -34,7 +35,7 @@ public function name_only() $this->assertEquals('j@example.com', $email); } - /** @test */ + #[Test] public function first_letters_of_names_and_last_name() { $predictEmail = new PredictEmail; @@ -48,7 +49,7 @@ public function first_letters_of_names_and_last_name() $this->assertEquals('jdoe@example.com', $email); } - /** @test */ + #[Test] public function is_valid() { $predictEmail = new PredictEmail;