From 034b8d0b9daf3e74aa14c6541eaeccffe5f0ef35 Mon Sep 17 00:00:00 2001 From: Alexis Gousseau Date: Tue, 20 Jun 2023 11:55:52 +0200 Subject: [PATCH] fix tests with policies --- app/Policies/CustomerPolicy.php | 27 + app/Policies/QuestionPolicy.php | 24 + .../DeleteUnconfirmedCustomers.php.html | 129 +-- .../Commands/GenerateCrmClient.php.html | 6 +- .../Commands/LdcWebStatusChecker.php.html | 6 +- .../Console/Commands/MigrateCrmUsers.php.html | 6 +- .../Console/Commands/StartStatJobs.php.html | 6 +- .../Console/Commands/UserCreate.php.html | 6 +- .../coverage/Console/Commands/dashboard.html | 10 +- tests/coverage/Console/Commands/index.html | 6 +- tests/coverage/Console/Kernel.php.html | 6 +- tests/coverage/Console/dashboard.html | 10 +- tests/coverage/Console/index.html | 6 +- tests/coverage/Enums/ApiError.php.html | 130 +-- tests/coverage/Enums/ApiStatus.php.html | 6 +- tests/coverage/Enums/ArcadiaMailType.php.html | 102 +- .../coverage/Enums/ArcadiaOrderType.php.html | 102 +- tests/coverage/Enums/Country.php.html | 384 ++++---- .../Enums/CustomerExportType.php.html | 6 +- tests/coverage/Enums/QuestionType.php.html | 102 +- tests/coverage/Enums/dashboard.html | 35 +- tests/coverage/Enums/index.html | 188 ++-- .../AbortRowImportException.php.html | 6 +- .../Api/V2/ApiErrorException.php.html | 120 +-- .../Exceptions/Api/V2/CrmException.php.html | 6 +- .../coverage/Exceptions/Api/V2/dashboard.html | 21 +- tests/coverage/Exceptions/Api/V2/index.html | 50 +- tests/coverage/Exceptions/Api/dashboard.html | 21 +- tests/coverage/Exceptions/Api/index.html | 50 +- tests/coverage/Exceptions/Handler.php.html | 200 ++-- tests/coverage/Exceptions/dashboard.html | 30 +- tests/coverage/Exceptions/index.html | 72 +- .../Controllers/AnswerController.php.html | 294 ++++-- .../Api/V1/ArcadiaController.php.html | 10 +- .../Api/V1/CustomerController.php.html | 6 +- .../Http/Controllers/Api/V1/dashboard.html | 6 +- .../Http/Controllers/Api/V1/index.html | 6 +- .../Api/V2/AnswerController.php.html | 110 +-- .../Controllers/Api/V2/ApiController.php.html | 102 +- .../Api/V2/ArcadiaController.php.html | 226 ++--- .../Api/V2/CustomerController.php.html | 378 ++++---- .../Api/V2/OptinController.php.html | 126 +-- .../Api/V2/QuestionController.php.html | 178 ++-- .../Api/V2/StatsController.php.html | 218 ++--- .../Http/Controllers/Api/V2/dashboard.html | 53 +- .../Http/Controllers/Api/V2/index.html | 262 +++--- .../Http/Controllers/Api/dashboard.html | 53 +- .../coverage/Http/Controllers/Api/index.html | 70 +- .../Http/Controllers/BrandController.php.html | 217 ++++- .../Http/Controllers/Controller.php.html | 182 +++- .../Controllers/CustomerController.php.html | 616 ++++++------ .../Http/Controllers/LoginController.php.html | 6 +- .../Controllers/QuestionController.php.html | 527 +++++++---- .../Controllers/ServiceController.php.html | 346 +++++-- .../SingleOptinController.php.html | 127 +-- .../Http/Controllers/StatsController.php.html | 6 +- .../coverage/Http/Controllers/dashboard.html | 53 +- tests/coverage/Http/Controllers/index.html | 70 +- tests/coverage/Http/Kernel.php.html | 28 +- .../Middleware/ApiCheckTimeStamps.php.html | 114 +-- .../Http/Middleware/ApiResponse.php.html | 128 +-- .../Http/Middleware/Authenticate.php.html | 108 +-- .../Http/Middleware/CheckBrand.php.html | 6 +- .../Http/Middleware/EncryptCookies.php.html | 6 +- .../Http/Middleware/JsonOnly.php.html | 112 +-- .../PreventRequestsDuringMaintenance.php.html | 6 +- .../RedirectIfAuthenticated.php.html | 6 +- .../Http/Middleware/TrimStrings.php.html | 6 +- .../Http/Middleware/TrustHosts.php.html | 6 +- .../Http/Middleware/TrustProxies.php.html | 6 +- .../Http/Middleware/VerifyCsrfToken.php.html | 6 +- .../Http/Middleware/XssSanitizer.php.html | 110 +-- tests/coverage/Http/Middleware/dashboard.html | 32 +- tests/coverage/Http/Middleware/index.html | 198 ++-- .../Answers/StoreAnswerRequest.php.html | 241 +++++ .../Answers/UpdateAnswerRequest.php.html | 110 +++ .../Http/Requests/Answers/dashboard.html | 290 ++++++ .../coverage/Http/Requests/Answers/index.html | 134 +++ .../Api/V2/AuthenticateRequest.php.html | 130 +-- .../Requests/Api/V2/BaseApiRequest.php.html | 102 +- .../Api/V2/GetBrandStatsRequest.php.html | 114 +-- .../Api/V2/GetQuestionStatsRequest.php.html | 58 +- .../SendArchadiaDefaultMailRequest.php.html | 196 ++-- .../V2/SendArchadiaGameMailRequest.php.html | 190 ++-- .../Api/V2/SingleOptinRequest.php.html | 102 +- .../Api/V2/StoreCustomerAnswers.php.html | 70 +- .../Api/V2/StoreCustomerRequest.php.html | 184 ++-- .../Api/V2/UpdateCustomerRequest.php.html | 152 +-- .../Http/Requests/Api/V2/dashboard.html | 62 +- .../coverage/Http/Requests/Api/V2/index.html | 428 ++++----- .../coverage/Http/Requests/Api/dashboard.html | 62 +- tests/coverage/Http/Requests/Api/index.html | 70 +- .../Brands/StoreBrandRequest.php.html | 241 +++++ .../Brands/UpdateBrandRequest.php.html | 110 +++ .../Http/Requests/Brands/dashboard.html | 290 ++++++ .../coverage/Http/Requests/Brands/index.html | 134 +++ .../Http/Requests/CustomerExport.php.html | 6 +- .../Requests/GenerateServiceToken.php.html | 6 +- .../Http/Requests/ManageBrandRequest.php.html | 6 +- .../Requests/ManageServiceRequest.php.html | 6 +- .../Http/Requests/QuestionExport.php.html | 6 +- .../Questions/StoreQuestionRequest.php.html | 245 +++++ .../Questions/UpdateQuestionRequest.php.html | 110 +++ .../Http/Requests/Questions/dashboard.html | 290 ++++++ .../Http/Requests/Questions/index.html | 134 +++ .../Services/StoreServiceRequest.php.html | 243 +++++ .../Services/UpdateServiceRequest.php.html | 110 +++ .../Http/Requests/Services/dashboard.html | 290 ++++++ .../Http/Requests/Services/index.html | 134 +++ .../Requests/StatsByBrandRequest.php.html | 6 +- .../Requests/StatsByQuestionRequest.php.html | 6 +- tests/coverage/Http/Requests/dashboard.html | 78 +- tests/coverage/Http/Requests/index.html | 182 +++- .../Resources/Api/V2/AnswersResource.php.html | 106 +-- .../Resources/Api/V2/ApiResponse.php.html | 136 +-- .../Api/V2/BrandStatsResource.php.html | 116 +-- .../Api/V2/CustomerResource.php.html | 180 ++-- .../Api/V2/QuestionStatsResource.php.html | 134 +-- .../Api/V2/QuestionsResource.php.html | 150 +-- .../Http/Resources/Api/V2/dashboard.html | 33 +- .../coverage/Http/Resources/Api/V2/index.html | 230 ++--- .../Http/Resources/Api/dashboard.html | 33 +- tests/coverage/Http/Resources/Api/index.html | 70 +- .../Http/Resources/CustomerResource.php.html | 6 +- .../Http/Resources/StatusResource.php.html | 6 +- tests/coverage/Http/Resources/dashboard.html | 33 +- tests/coverage/Http/Resources/index.html | 70 +- .../Http/Sanitizers/RemoveSpaces.php.html | 102 +- tests/coverage/Http/Sanitizers/dashboard.html | 16 +- tests/coverage/Http/Sanitizers/index.html | 70 +- tests/coverage/Http/dashboard.html | 156 +++- tests/coverage/Http/index.html | 198 ++-- tests/coverage/Jobs/SetServiceStats.php.html | 6 +- tests/coverage/Jobs/StartStatJobs.php.html | 6 +- tests/coverage/Jobs/StatJob.php.html | 6 +- .../UpdateCustomerLastConnection.php.html | 6 +- tests/coverage/Jobs/dashboard.html | 6 +- tests/coverage/Jobs/index.html | 6 +- tests/coverage/Lib/Helper.php.html | 282 +++--- tests/coverage/Lib/MigrateOldData.php.html | 6 +- tests/coverage/Lib/dashboard.html | 31 +- tests/coverage/Lib/index.html | 50 +- .../Mail/CourrierArcadiaError.php.html | 6 +- .../Mail/ServiceCredentialRenewed.php.html | 6 +- tests/coverage/Mail/dashboard.html | 6 +- tests/coverage/Mail/index.html | 6 +- tests/coverage/Models/Answer.php.html | 247 ++--- tests/coverage/Models/Brand.php.html | 441 +++++---- tests/coverage/Models/BrandStat.php.html | 36 +- tests/coverage/Models/Customer.php.html | 422 ++++----- tests/coverage/Models/CustomerAnswer.php.html | 158 ++-- tests/coverage/Models/CustomerInfo.php.html | 134 +-- tests/coverage/Models/CustomerLogin.php.html | 170 ++-- .../Models/CustomerOptInHistory.php.html | 130 +-- tests/coverage/Models/Question.php.html | 312 +++---- tests/coverage/Models/Service.php.html | 876 +++++++++--------- tests/coverage/Models/ServiceStat.php.html | 130 +-- tests/coverage/Models/SingleOptin.php.html | 212 ++--- tests/coverage/Models/User.php.html | 6 +- tests/coverage/Models/dashboard.html | 104 ++- tests/coverage/Models/index.html | 496 +++++----- .../coverage/Policies/CustomerPolicy.php.html | 87 +- .../coverage/Policies/QuestionPolicy.php.html | 81 +- tests/coverage/Policies/dashboard.html | 14 +- tests/coverage/Policies/index.html | 71 +- .../Providers/AppServiceProvider.php.html | 6 +- .../Providers/AuthServiceProvider.php.html | 212 ++--- .../Providers/EventServiceProvider.php.html | 6 +- .../Providers/RouteServiceProvider.php.html | 180 ++-- .../TranslationServiceProvider.php.html | 296 ++++++ .../Providers/ViewServiceProvider.php.html | 176 ++++ tests/coverage/Providers/dashboard.html | 24 +- tests/coverage/Providers/index.html | 130 ++- tests/coverage/dashboard.html | 312 +++++-- tests/coverage/index.html | 220 ++--- 175 files changed, 12575 insertions(+), 7721 deletions(-) create mode 100644 app/Policies/CustomerPolicy.php create mode 100644 app/Policies/QuestionPolicy.php create mode 100644 tests/coverage/Http/Requests/Answers/StoreAnswerRequest.php.html create mode 100644 tests/coverage/Http/Requests/Answers/UpdateAnswerRequest.php.html create mode 100644 tests/coverage/Http/Requests/Answers/dashboard.html create mode 100644 tests/coverage/Http/Requests/Answers/index.html create mode 100644 tests/coverage/Http/Requests/Brands/StoreBrandRequest.php.html create mode 100644 tests/coverage/Http/Requests/Brands/UpdateBrandRequest.php.html create mode 100644 tests/coverage/Http/Requests/Brands/dashboard.html create mode 100644 tests/coverage/Http/Requests/Brands/index.html create mode 100644 tests/coverage/Http/Requests/Questions/StoreQuestionRequest.php.html create mode 100644 tests/coverage/Http/Requests/Questions/UpdateQuestionRequest.php.html create mode 100644 tests/coverage/Http/Requests/Questions/dashboard.html create mode 100644 tests/coverage/Http/Requests/Questions/index.html create mode 100644 tests/coverage/Http/Requests/Services/StoreServiceRequest.php.html create mode 100644 tests/coverage/Http/Requests/Services/UpdateServiceRequest.php.html create mode 100644 tests/coverage/Http/Requests/Services/dashboard.html create mode 100644 tests/coverage/Http/Requests/Services/index.html create mode 100644 tests/coverage/Providers/TranslationServiceProvider.php.html create mode 100644 tests/coverage/Providers/ViewServiceProvider.php.html diff --git a/app/Policies/CustomerPolicy.php b/app/Policies/CustomerPolicy.php new file mode 100644 index 0000000..df14315 --- /dev/null +++ b/app/Policies/CustomerPolicy.php @@ -0,0 +1,27 @@ +login($service->brand)); + } +} diff --git a/app/Policies/QuestionPolicy.php b/app/Policies/QuestionPolicy.php new file mode 100644 index 0000000..e6598a7 --- /dev/null +++ b/app/Policies/QuestionPolicy.php @@ -0,0 +1,24 @@ +brand->id === $question->brand_id; + } +} diff --git a/tests/coverage/Console/Commands/DeleteUnconfirmedCustomers.php.html b/tests/coverage/Console/Commands/DeleteUnconfirmedCustomers.php.html index 2c3b4d7..9d6ae80 100644 --- a/tests/coverage/Console/Commands/DeleteUnconfirmedCustomers.php.html +++ b/tests/coverage/Console/Commands/DeleteUnconfirmedCustomers.php.html @@ -2,7 +2,7 @@ - Code Coverage for /home/jeremy/projets/crm/app/Console/Commands/DeleteUnconfirmedCustomers.php + Code Coverage for /app/srcs/app/Console/Commands/DeleteUnconfirmedCustomers.php @@ -16,7 +16,7 @@