From ca76a0280ea66d2617fe7ce514e5d946e5d7c862 Mon Sep 17 00:00:00 2001 From: tmbattey-2021 Date: Tue, 5 Nov 2024 09:21:06 -0500 Subject: [PATCH 01/21] enhance group events DEX message for additional fields such as scope description original commit was modified by bpow to remove extraneous file changes in configs.json and groups.php, replace "magic numbers" with meaningful constants, and to not bump message version to 2.0 quite yet --- .../Traits/IsPublishableApplicationEvent.php | 24 ++++++++++++++----- app/Modules/Group/Models/Group.php | 5 ++++ config/dx.php | 4 ++-- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/app/Modules/Group/Events/Traits/IsPublishableApplicationEvent.php b/app/Modules/Group/Events/Traits/IsPublishableApplicationEvent.php index 5f6e62b19..0296a376d 100644 --- a/app/Modules/Group/Events/Traits/IsPublishableApplicationEvent.php +++ b/app/Modules/Group/Events/Traits/IsPublishableApplicationEvent.php @@ -20,15 +20,27 @@ public function getEventType(): string public function getPublishableMessage(): array { return [ - 'expert_panel' => [ - 'id' => $this->group->uuid, - 'name' => $this->group->displayName, - 'type' => $this->group->fullType->name, - 'affiliation_id' => $this->group->expertPanel->affiliation_id - ], + 'expert_panel' => array_merge( + [ + 'id' => $this->group->uuid, + 'name' => $this->group->name, + 'short_name' => $this->group->expertPanel->short_base_name, + 'status' => optional($this->group->groupStatus)->name, // Retrieve the status name + 'parent_group' => optional($this->group->parentGroup)->name, + 'type' => $this->group->fullType->name, + 'affiliation_id' => $this->group->expertPanel->affiliation_id, + 'scope_description' => $this->group->expertPanel->scope_description, + ], + // Conditionally add vcep fields below if type is 'vcep' + $this->group->fullType->name === 'vcep' ? ['clinvar_id' => null] : [], + $this->group->fullType->name === 'vcep' ? ['clinvar_url' => null] : [], + $this->group->fullType->name === 'vcep' ? ['cspec_url' => $this->group->expertPanel->affiliation_id] : [], + $this->group->fullType->name === 'vcep' ? ['cspec_web_address' => null] : [], + ) ]; } + public function mapGeneForMessage($gene): array { $messageGene = [ diff --git a/app/Modules/Group/Models/Group.php b/app/Modules/Group/Models/Group.php index 4a0038e1c..463a972f2 100644 --- a/app/Modules/Group/Models/Group.php +++ b/app/Modules/Group/Models/Group.php @@ -279,4 +279,9 @@ protected static function newFactory() { return new GroupFactory(); } + + public function parentGroup(): BelongsTo + { + return $this->belongsTo(Group::class, 'parent_id', 'id'); + } } diff --git a/config/dx.php b/config/dx.php index cae08a0eb..a0bf85b0c 100644 --- a/config/dx.php +++ b/config/dx.php @@ -55,8 +55,8 @@ * The current schema version of messsages sent to a particular topic. */ 'schema_versions' => [ - 'gpm-general-events' => '1.1.0', - 'gpm-person-events' => '1.1.0' + 'gpm-general-events' => '1.9.9', + 'gpm-person-events' => '1.9.9' ] ]; From 4bc0635fdbfae1af98d06492f33143776c0a5f14 Mon Sep 17 00:00:00 2001 From: tmbattey-2021 Date: Tue, 19 Nov 2024 14:35:47 -0500 Subject: [PATCH 02/21] removed null fields for vcep groups --- .../Group/Events/Traits/IsPublishableApplicationEvent.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/Modules/Group/Events/Traits/IsPublishableApplicationEvent.php b/app/Modules/Group/Events/Traits/IsPublishableApplicationEvent.php index 0296a376d..9e8bdeb90 100644 --- a/app/Modules/Group/Events/Traits/IsPublishableApplicationEvent.php +++ b/app/Modules/Group/Events/Traits/IsPublishableApplicationEvent.php @@ -31,11 +31,8 @@ public function getPublishableMessage(): array 'affiliation_id' => $this->group->expertPanel->affiliation_id, 'scope_description' => $this->group->expertPanel->scope_description, ], - // Conditionally add vcep fields below if type is 'vcep' - $this->group->fullType->name === 'vcep' ? ['clinvar_id' => null] : [], - $this->group->fullType->name === 'vcep' ? ['clinvar_url' => null] : [], + // Conditionally add vcep field below if type is 'vcep' $this->group->fullType->name === 'vcep' ? ['cspec_url' => $this->group->expertPanel->affiliation_id] : [], - $this->group->fullType->name === 'vcep' ? ['cspec_web_address' => null] : [], ) ]; } From 6780123f316b5a12736e8272709fc06b029d5168 Mon Sep 17 00:00:00 2001 From: Bradford Powell Date: Wed, 20 Nov 2024 11:06:39 -0500 Subject: [PATCH 03/21] clean up uses of 'optional()' * not needed for status since group_status is specified as NOT NULL and foreign key, so should always be present. I'd rather see an error than have it silently produce an empty value * use null-safe dereference rather than optional for parent_group. This is considered by many to be easier to read, and as it was written (with "->name" outside of the parentheses, I don't think it would have worked for all of the null-possible cases as it was written, anyway (if there was no parent group, then `optional($this->group->parentGroup)` would give an optional with null value, so we'd get an error when trying to access ->name from that --- .../Group/Events/Traits/IsPublishableApplicationEvent.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Modules/Group/Events/Traits/IsPublishableApplicationEvent.php b/app/Modules/Group/Events/Traits/IsPublishableApplicationEvent.php index 9e8bdeb90..80d347f7f 100644 --- a/app/Modules/Group/Events/Traits/IsPublishableApplicationEvent.php +++ b/app/Modules/Group/Events/Traits/IsPublishableApplicationEvent.php @@ -25,8 +25,8 @@ public function getPublishableMessage(): array 'id' => $this->group->uuid, 'name' => $this->group->name, 'short_name' => $this->group->expertPanel->short_base_name, - 'status' => optional($this->group->groupStatus)->name, // Retrieve the status name - 'parent_group' => optional($this->group->parentGroup)->name, + 'status' => $this->group->groupStatus->name, + 'parent_group' => $this->group->parentGroup?->name, // TODO: check representation when no parent: null or empty string? 'type' => $this->group->fullType->name, 'affiliation_id' => $this->group->expertPanel->affiliation_id, 'scope_description' => $this->group->expertPanel->scope_description, From b280902a1542b6c6c449b9915a8a413250bb0749 Mon Sep 17 00:00:00 2001 From: Bradford Powell Date: Tue, 17 Dec 2024 13:47:29 -0500 Subject: [PATCH 04/21] cleaning unused code/imports --- .../Events/ExpertPanelAttributesUpdated.php | 3 --- .../ExpertPanel/Events/ExpertPanelEvent.php | 2 -- app/Modules/ExpertPanel/Events/StepApproved.php | 17 +---------------- app/Modules/Group/Events/GeneEvent.php | 2 -- app/Modules/Group/Events/GeneRemoved.php | 3 --- app/Modules/Group/Events/GroupEvent.php | 4 ---- app/Modules/Group/Events/MemberAdded.php | 4 ---- .../Group/Events/MemberPermissionRevoked.php | 4 ---- .../Group/Events/ScopeDescriptionUpdated.php | 4 ---- app/Modules/Person/Events/PersonCreated.php | 3 --- app/Modules/Person/Events/PersonEvent.php | 4 ---- app/Modules/Person/Events/ProfileUpdated.php | 3 --- 12 files changed, 1 insertion(+), 52 deletions(-) diff --git a/app/Modules/ExpertPanel/Events/ExpertPanelAttributesUpdated.php b/app/Modules/ExpertPanel/Events/ExpertPanelAttributesUpdated.php index 8be662770..d3fae1676 100644 --- a/app/Modules/ExpertPanel/Events/ExpertPanelAttributesUpdated.php +++ b/app/Modules/ExpertPanel/Events/ExpertPanelAttributesUpdated.php @@ -3,14 +3,11 @@ namespace App\Modules\ExpertPanel\Events; use App\Events\PublishableEvent; -use Illuminate\Broadcasting\Channel; use Illuminate\Queue\SerializesModels; use Illuminate\Broadcasting\PrivateChannel; -use Illuminate\Broadcasting\PresenceChannel; use App\Modules\ExpertPanel\Models\ExpertPanel; use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Broadcasting\InteractsWithSockets; -use Illuminate\Contracts\Broadcasting\ShouldBroadcast; class ExpertPanelAttributesUpdated extends ExpertPanelEvent implements PublishableEvent { diff --git a/app/Modules/ExpertPanel/Events/ExpertPanelEvent.php b/app/Modules/ExpertPanel/Events/ExpertPanelEvent.php index 18d26acf4..164270fad 100644 --- a/app/Modules/ExpertPanel/Events/ExpertPanelEvent.php +++ b/app/Modules/ExpertPanel/Events/ExpertPanelEvent.php @@ -2,7 +2,6 @@ namespace App\Modules\ExpertPanel\Events; -use DateTime; use Illuminate\Queue\SerializesModels; use App\Modules\ExpertPanel\Models\ExpertPanel; use App\Events\RecordableEvent; @@ -10,7 +9,6 @@ use Illuminate\Broadcasting\InteractsWithSockets; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Carbon; -use Ramsey\Uuid\Type\Integer; /** * @property App\Modules\Group\Models\Group $group diff --git a/app/Modules/ExpertPanel/Events/StepApproved.php b/app/Modules/ExpertPanel/Events/StepApproved.php index 323646fbd..474874658 100644 --- a/app/Modules/ExpertPanel/Events/StepApproved.php +++ b/app/Modules/ExpertPanel/Events/StepApproved.php @@ -4,16 +4,11 @@ use Exception; use Illuminate\Support\Carbon; -use Illuminate\Broadcasting\Channel; use Illuminate\Queue\SerializesModels; -use Illuminate\Broadcasting\PrivateChannel; -use Illuminate\Broadcasting\PresenceChannel; use Illuminate\Foundation\Events\Dispatchable; use App\Modules\ExpertPanel\Models\ExpertPanel; use App\Modules\Group\Events\PublishableApplicationEvent; -use Illuminate\Support\Carbon as SupportCarbon; use Illuminate\Broadcasting\InteractsWithSockets; -use Illuminate\Contracts\Broadcasting\ShouldBroadcast; use App\Modules\Group\Events\Traits\IsPublishableApplicationEvent; class StepApproved extends ExpertPanelEvent implements PublishableApplicationEvent @@ -93,14 +88,4 @@ public function getPublishableMessage(): array } - - /** - * Get the channels the event should broadcast on. - * - * @return \Illuminate\Broadcasting\Channel|array - */ - // public function broadcastOn() - // { - // return new PrivateChannel('channel-name'); - // } -} +} \ No newline at end of file diff --git a/app/Modules/Group/Events/GeneEvent.php b/app/Modules/Group/Events/GeneEvent.php index 8b9fb223f..06eec1c44 100644 --- a/app/Modules/Group/Events/GeneEvent.php +++ b/app/Modules/Group/Events/GeneEvent.php @@ -1,11 +1,9 @@ Date: Tue, 17 Dec 2024 14:14:31 -0500 Subject: [PATCH 05/21] (WIP) make ExpertPanelAttributesUpdated use IsPublishableApplicationEvent has several TODOs for cleanup: - removing usused/commented code - possibly move membership description up to IsPublishableApplicationEvent - double-check display_name --- .../Events/ExpertPanelAttributesUpdated.php | 38 ++++++++++++------- .../Traits/IsPublishableApplicationEvent.php | 1 + 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/app/Modules/ExpertPanel/Events/ExpertPanelAttributesUpdated.php b/app/Modules/ExpertPanel/Events/ExpertPanelAttributesUpdated.php index d3fae1676..1c09fecc7 100644 --- a/app/Modules/ExpertPanel/Events/ExpertPanelAttributesUpdated.php +++ b/app/Modules/ExpertPanel/Events/ExpertPanelAttributesUpdated.php @@ -2,23 +2,27 @@ namespace App\Modules\ExpertPanel\Events; -use App\Events\PublishableEvent; +use App\Modules\Group\Events\PublishableApplicationEvent; +use App\Modules\Group\Events\Traits\IsPublishableApplicationEvent; use Illuminate\Queue\SerializesModels; use Illuminate\Broadcasting\PrivateChannel; use App\Modules\ExpertPanel\Models\ExpertPanel; use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Broadcasting\InteractsWithSockets; -class ExpertPanelAttributesUpdated extends ExpertPanelEvent implements PublishableEvent +class ExpertPanelAttributesUpdated extends ExpertPanelEvent implements PublishableApplicationEvent { use Dispatchable, InteractsWithSockets, SerializesModels; + use IsPublishableApplicationEvent { + getPublishableMessage as protected getBaseMessage; + } /** * Create a new event instance. * * @return void */ - public function __construct(public ExpertPanel $application, public array $attributes) + public function __construct(public ExpertPanel $expertPanel, public array $attributes) { // } @@ -45,19 +49,27 @@ public function getEventType():string public function getPublishableMessage(): array { + // TODO: double-check that the "Name" is what the website team wants + $message = $this->getBaseMessage(); + // TODO: check if these fields are still used/needed, since they don't necessarily show up elsewhere, or maybe should be in trait? + $message['membership_description'] = $this->expertPanel->membership_description; + // $message['hypothesis_group'] = $this->expertPanel->hypothesis_group; // currently unused? + return $message; + /* return [ "expert_panel" => [ - 'id' => $this->application->group->uuid, - 'name' => $this->application->display_name, - 'type' => $this->application->group->type->name, - 'affiliation_id' => $this->application->affiliation_id, - 'long_base_name' => $this->application->long_base_name, - 'short_base_name' => $this->application->short_base_name, - 'hypothesis_group' => $this->application->hypothesis_group, - 'membership_description' => $this->application->membership_description, - 'scope_description' => $this->application->scope_description + 'id' => $this->expertPanel->group->uuid, + 'name' => $this->expertPanel->display_name, + 'type' => $this->expertPanel->group->type->name, + 'affiliation_id' => $this->expertPanel->affiliation_id, + 'long_base_name' => $this->expertPanel->long_base_name, + 'short_base_name' => $this->expertPanel->short_base_name, + 'hypothesis_group' => $this->expertPanel->hypothesis_group, + 'membership_description' => $this->expertPanel->membership_description, + 'scope_description' => $this->expertPanel->scope_description ] ]; + */ } /** @@ -66,7 +78,7 @@ public function getPublishableMessage(): array public function shouldPublish(): bool { return parent::shouldPublish() - && $this->application->definitionIsApproved; + && $this->expertPanel->definitionIsApproved; } /** diff --git a/app/Modules/Group/Events/Traits/IsPublishableApplicationEvent.php b/app/Modules/Group/Events/Traits/IsPublishableApplicationEvent.php index 80d347f7f..74aefa719 100644 --- a/app/Modules/Group/Events/Traits/IsPublishableApplicationEvent.php +++ b/app/Modules/Group/Events/Traits/IsPublishableApplicationEvent.php @@ -30,6 +30,7 @@ public function getPublishableMessage(): array 'type' => $this->group->fullType->name, 'affiliation_id' => $this->group->expertPanel->affiliation_id, 'scope_description' => $this->group->expertPanel->scope_description, + // TODO: consider adding membership_description ], // Conditionally add vcep field below if type is 'vcep' $this->group->fullType->name === 'vcep' ? ['cspec_url' => $this->group->expertPanel->affiliation_id] : [], From 922390e128fa5b805627f5ebff13701633ee6ed2 Mon Sep 17 00:00:00 2001 From: Bradford Powell Date: Tue, 17 Dec 2024 14:59:50 -0500 Subject: [PATCH 06/21] cleanup moving towards recognition that PublishableApplicationEvent was often used for GroupEvents --- .../Traits/IsPublishableApplicationEvent.php | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/app/Modules/Group/Events/Traits/IsPublishableApplicationEvent.php b/app/Modules/Group/Events/Traits/IsPublishableApplicationEvent.php index 74aefa719..d7dd99242 100644 --- a/app/Modules/Group/Events/Traits/IsPublishableApplicationEvent.php +++ b/app/Modules/Group/Events/Traits/IsPublishableApplicationEvent.php @@ -19,18 +19,28 @@ public function getEventType(): string public function getPublishableMessage(): array { - return [ - 'expert_panel' => array_merge( - [ + $message = [ + 'group' => [ 'id' => $this->group->uuid, 'name' => $this->group->name, - 'short_name' => $this->group->expertPanel->short_base_name, 'status' => $this->group->groupStatus->name, 'parent_group' => $this->group->parentGroup?->name, // TODO: check representation when no parent: null or empty string? 'type' => $this->group->fullType->name, - 'affiliation_id' => $this->group->expertPanel->affiliation_id, - 'scope_description' => $this->group->expertPanel->scope_description, - // TODO: consider adding membership_description + ], + ]; + if ($this->group->isEp()) { + $message['group']['affiliation_id'] = $this->group->expertPanel->affiliation_id; + $message['group']['scope_description'] = $this->group->expertPanel->scope_description; + $message['group']['short_name'] = $this->group->expertPanel->short_base_name; + // TODO: not sure about these fields + // $message['group']['long_base_name'] = $this->group->expertPanel->long_base_name; + // $message['group']['hypothesis_group'] = $this->group->expertPanel->hypothesis_group; + // $message['group']['membership_description'] = $this->group->expertPanel->membership_description; + + } + return [ + 'group' => array_merge( + [ ], // Conditionally add vcep field below if type is 'vcep' $this->group->fullType->name === 'vcep' ? ['cspec_url' => $this->group->expertPanel->affiliation_id] : [], From 97eae5808e9dc10ad6efb1e9911840faa82a3f59 Mon Sep 17 00:00:00 2001 From: Bradford Powell Date: Tue, 17 Dec 2024 15:33:51 -0500 Subject: [PATCH 07/21] renaming to fit reality --- .../Events/ExpertPanelAttributesUpdated.php | 50 +++++-------------- .../ExpertPanel/Events/StepApproved.php | 8 +-- .../Events/StepDateApprovedUpdated.php | 8 +-- .../ExpertPanelAffiliationIdUpdated.php | 7 +-- .../Group/Events/ExpertPanelNameUpdated.php | 6 +-- app/Modules/Group/Events/GeneEvent.php | 6 +-- app/Modules/Group/Events/GenesAdded.php | 1 - app/Modules/Group/Events/GroupMemberEvent.php | 8 +-- ...nt.php => PublishableExpertPanelEvent.php} | 3 +- .../Traits/IsPublishableExpertPanelEvent.php | 36 +++++++++++++ ...nEvent.php => IsPublishableGroupEvent.php} | 46 +++-------------- .../Providers/GroupModuleServiceProvider.php | 2 +- 12 files changed, 79 insertions(+), 102 deletions(-) rename app/Modules/Group/Events/{PublishableApplicationEvent.php => PublishableExpertPanelEvent.php} (67%) create mode 100644 app/Modules/Group/Events/Traits/IsPublishableExpertPanelEvent.php rename app/Modules/Group/Events/Traits/{IsPublishableApplicationEvent.php => IsPublishableGroupEvent.php} (52%) diff --git a/app/Modules/ExpertPanel/Events/ExpertPanelAttributesUpdated.php b/app/Modules/ExpertPanel/Events/ExpertPanelAttributesUpdated.php index 1c09fecc7..5176835b2 100644 --- a/app/Modules/ExpertPanel/Events/ExpertPanelAttributesUpdated.php +++ b/app/Modules/ExpertPanel/Events/ExpertPanelAttributesUpdated.php @@ -2,20 +2,18 @@ namespace App\Modules\ExpertPanel\Events; -use App\Modules\Group\Events\PublishableApplicationEvent; -use App\Modules\Group\Events\Traits\IsPublishableApplicationEvent; +use App\Modules\Group\Events\PublishableExpertPanelEvent; +use App\Modules\Group\Events\Traits\IsPublishableExpertPanelEvent; +use App\Modules\Group\Events\GroupEvent; use Illuminate\Queue\SerializesModels; use Illuminate\Broadcasting\PrivateChannel; use App\Modules\ExpertPanel\Models\ExpertPanel; use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Broadcasting\InteractsWithSockets; -class ExpertPanelAttributesUpdated extends ExpertPanelEvent implements PublishableApplicationEvent +class ExpertPanelAttributesUpdated extends GroupEvent implements PublishableExpertPanelEvent { - use Dispatchable, InteractsWithSockets, SerializesModels; - use IsPublishableApplicationEvent { - getPublishableMessage as protected getBaseMessage; - } + use Dispatchable, InteractsWithSockets, SerializesModels, IsPublishableExpertPanelEvent; /** * Create a new event instance. @@ -27,56 +25,32 @@ public function __construct(public ExpertPanel $expertPanel, public array $attri // } - public function getLogEntry():string + public function getLogEntry(): string { $parts = []; - foreach ($this->attributes as $key=>$value) { - $parts[] = $key.' = '.$value; + foreach ($this->attributes as $key => $value) { + $parts[] = $key . ' = ' . $value; } - return 'Attributes updated: '.implode('; ', $parts); + return 'Attributes updated: ' . implode('; ', $parts); } - public function getProperties():array + public function getProperties(): array { return $this->attributes; } - public function getEventType():string + public function getEventType(): string { return 'ep_info_updated'; } - public function getPublishableMessage(): array - { - // TODO: double-check that the "Name" is what the website team wants - $message = $this->getBaseMessage(); - // TODO: check if these fields are still used/needed, since they don't necessarily show up elsewhere, or maybe should be in trait? - $message['membership_description'] = $this->expertPanel->membership_description; - // $message['hypothesis_group'] = $this->expertPanel->hypothesis_group; // currently unused? - return $message; - /* - return [ - "expert_panel" => [ - 'id' => $this->expertPanel->group->uuid, - 'name' => $this->expertPanel->display_name, - 'type' => $this->expertPanel->group->type->name, - 'affiliation_id' => $this->expertPanel->affiliation_id, - 'long_base_name' => $this->expertPanel->long_base_name, - 'short_base_name' => $this->expertPanel->short_base_name, - 'hypothesis_group' => $this->expertPanel->hypothesis_group, - 'membership_description' => $this->expertPanel->membership_description, - 'scope_description' => $this->expertPanel->scope_description - ] - ]; - */ - } - /** * For PublishableEvent interface that is applied to many sub-classes */ public function shouldPublish(): bool { + // FIXME: allow WG events to be published return parent::shouldPublish() && $this->expertPanel->definitionIsApproved; } diff --git a/app/Modules/ExpertPanel/Events/StepApproved.php b/app/Modules/ExpertPanel/Events/StepApproved.php index 474874658..75de6b2e4 100644 --- a/app/Modules/ExpertPanel/Events/StepApproved.php +++ b/app/Modules/ExpertPanel/Events/StepApproved.php @@ -7,14 +7,14 @@ use Illuminate\Queue\SerializesModels; use Illuminate\Foundation\Events\Dispatchable; use App\Modules\ExpertPanel\Models\ExpertPanel; -use App\Modules\Group\Events\PublishableApplicationEvent; +use App\Modules\Group\Events\PublishableExpertPanelEvent; use Illuminate\Broadcasting\InteractsWithSockets; -use App\Modules\Group\Events\Traits\IsPublishableApplicationEvent; +use App\Modules\Group\Events\Traits\IsPublishableExpertPanelEvent; -class StepApproved extends ExpertPanelEvent implements PublishableApplicationEvent +class StepApproved extends ExpertPanelEvent implements PublishableExpertPanelEvent { use Dispatchable, InteractsWithSockets, SerializesModels; - use IsPublishableApplicationEvent { + use IsPublishableExpertPanelEvent { getPublishableMessage as protected getBaseMessage; } diff --git a/app/Modules/ExpertPanel/Events/StepDateApprovedUpdated.php b/app/Modules/ExpertPanel/Events/StepDateApprovedUpdated.php index 9100adb27..fe8b472f1 100644 --- a/app/Modules/ExpertPanel/Events/StepDateApprovedUpdated.php +++ b/app/Modules/ExpertPanel/Events/StepDateApprovedUpdated.php @@ -5,14 +5,14 @@ use Illuminate\Queue\SerializesModels; use Illuminate\Foundation\Events\Dispatchable; use App\Modules\ExpertPanel\Models\ExpertPanel; -use App\Modules\Group\Events\PublishableApplicationEvent; -use App\Modules\Group\Events\Traits\IsPublishableApplicationEvent; +use App\Modules\Group\Events\PublishableExpertPanelEvent; +use App\Modules\Group\Events\Traits\IsPublishableExpertPanelEvent; use Illuminate\Broadcasting\InteractsWithSockets; -class StepDateApprovedUpdated extends ExpertPanelEvent implements PublishableApplicationEvent +class StepDateApprovedUpdated extends ExpertPanelEvent implements PublishableExpertPanelEvent { use Dispatchable, InteractsWithSockets, SerializesModels; - use IsPublishableApplicationEvent { + use IsPublishableExpertPanelEvent { getPublishableMessage as protected getBaseMessage; } diff --git a/app/Modules/Group/Events/ExpertPanelAffiliationIdUpdated.php b/app/Modules/Group/Events/ExpertPanelAffiliationIdUpdated.php index 20c4584ec..a3cc16c09 100644 --- a/app/Modules/Group/Events/ExpertPanelAffiliationIdUpdated.php +++ b/app/Modules/Group/Events/ExpertPanelAffiliationIdUpdated.php @@ -7,11 +7,12 @@ use Illuminate\Broadcasting\PrivateChannel; use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Broadcasting\InteractsWithSockets; -use App\Modules\Group\Events\Traits\IsPublishableApplicationEvent; +use App\Modules\Group\Events\Traits\IsPublishableGroupEvent; +use App\Events\PublishableEvent; -class ExpertPanelAffiliationIdUpdated extends GroupEvent implements PublishableApplicationEvent +class ExpertPanelAffiliationIdUpdated extends GroupEvent implements PublishableEvent { - use Dispatchable, InteractsWithSockets, SerializesModels, IsPublishableApplicationEvent; + use Dispatchable, InteractsWithSockets, SerializesModels, IsPublishableGroupEvent; /** * Create a new event instance. diff --git a/app/Modules/Group/Events/ExpertPanelNameUpdated.php b/app/Modules/Group/Events/ExpertPanelNameUpdated.php index 54ef3e0fb..64ade4665 100644 --- a/app/Modules/Group/Events/ExpertPanelNameUpdated.php +++ b/app/Modules/Group/Events/ExpertPanelNameUpdated.php @@ -2,19 +2,19 @@ namespace App\Modules\Group\Events; -use App\Modules\Group\Events\Traits\IsPublishableApplicationEvent; +use App\Modules\Group\Events\Traits\IsPublishableExpertPanelEvent; use App\Modules\Group\Models\Group; use Illuminate\Queue\SerializesModels; use Illuminate\Broadcasting\PrivateChannel; use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Broadcasting\InteractsWithSockets; -class ExpertPanelNameUpdated extends GroupEvent implements PublishableApplicationEvent +class ExpertPanelNameUpdated extends GroupEvent implements PublishableExpertPanelEvent { use Dispatchable, InteractsWithSockets, SerializesModels, - IsPublishableApplicationEvent; + IsPublishableExpertPanelEvent; /** * Create a new event instance. diff --git a/app/Modules/Group/Events/GeneEvent.php b/app/Modules/Group/Events/GeneEvent.php index 06eec1c44..f064ad189 100644 --- a/app/Modules/Group/Events/GeneEvent.php +++ b/app/Modules/Group/Events/GeneEvent.php @@ -3,11 +3,11 @@ use App\Modules\Group\Events\GroupEvent; use App\Modules\Group\Events\GeneEventInterface; -use App\Modules\Group\Events\Traits\IsPublishableApplicationEvent; +use App\Modules\Group\Events\Traits\IsPublishableExpertPanelEvent; -abstract class GeneEvent extends GroupEvent implements GeneEventInterface, PublishableApplicationEvent +abstract class GeneEvent extends GroupEvent implements GeneEventInterface, PublishableExpertPanelEvent { - use IsPublishableApplicationEvent { + use IsPublishableExpertPanelEvent { getPublishableMessage as protected getBaseMessage; } diff --git a/app/Modules/Group/Events/GenesAdded.php b/app/Modules/Group/Events/GenesAdded.php index b14cd9724..8d88bbb04 100644 --- a/app/Modules/Group/Events/GenesAdded.php +++ b/app/Modules/Group/Events/GenesAdded.php @@ -7,7 +7,6 @@ use App\Modules\Group\Events\GeneEvent; use Illuminate\Broadcasting\PrivateChannel; use Illuminate\Foundation\Events\Dispatchable; -use App\Modules\Group\Events\Traits\IsPublishableApplicationEvent; use Illuminate\Broadcasting\InteractsWithSockets; class GenesAdded extends GeneEvent diff --git a/app/Modules/Group/Events/GroupMemberEvent.php b/app/Modules/Group/Events/GroupMemberEvent.php index f51adf7d3..96a87ba21 100644 --- a/app/Modules/Group/Events/GroupMemberEvent.php +++ b/app/Modules/Group/Events/GroupMemberEvent.php @@ -2,12 +2,13 @@ namespace App\Modules\Group\Events; -use App\Modules\Group\Events\Traits\IsPublishableApplicationEvent; +use App\Modules\Group\Events\Traits\IsPublishableGroupEvent; use App\Modules\Group\Models\GroupMember; +use App\Events\PublishableEvent; -abstract class GroupMemberEvent extends GroupEvent implements PublishableApplicationEvent +abstract class GroupMemberEvent extends GroupEvent implements PublishableEvent { - use IsPublishableApplicationEvent { + use IsPublishableGroupEvent { getPublishableMessage as protected getBaseMessage; } @@ -38,6 +39,7 @@ public function getPublishableMessage(): array */ public function shouldPublish(): bool { + // FIXME: allow WG events to be published return parent::shouldPublish() && $this->group->expertPanel->definitionIsApproved; } diff --git a/app/Modules/Group/Events/PublishableApplicationEvent.php b/app/Modules/Group/Events/PublishableExpertPanelEvent.php similarity index 67% rename from app/Modules/Group/Events/PublishableApplicationEvent.php rename to app/Modules/Group/Events/PublishableExpertPanelEvent.php index e7028a5fd..3eb1ce686 100644 --- a/app/Modules/Group/Events/PublishableApplicationEvent.php +++ b/app/Modules/Group/Events/PublishableExpertPanelEvent.php @@ -2,10 +2,9 @@ namespace App\Modules\Group\Events; -use Illuminate\Support\Carbon; use App\Events\PublishableEvent; -interface PublishableApplicationEvent extends PublishableEvent +interface PublishableExpertPanelEvent extends PublishableEvent { public function mapGeneForMessage($gene): array; public function mapMemberForMessage($member): array; diff --git a/app/Modules/Group/Events/Traits/IsPublishableExpertPanelEvent.php b/app/Modules/Group/Events/Traits/IsPublishableExpertPanelEvent.php new file mode 100644 index 000000000..0ce810ebe --- /dev/null +++ b/app/Modules/Group/Events/Traits/IsPublishableExpertPanelEvent.php @@ -0,0 +1,36 @@ + $gene->hgnc_id, + 'gene_symbol' => $gene->gene_symbol, + ]; + + if ($gene->mondo_id) { + $messageGene['mondo_id'] = $gene->mondo_id; + $messageGene['disease_name'] = $gene->disease_name; + $messageGene['disease_entity'] = $gene->disease_entity; + } + + return $messageGene; + } + + public function mapMemberForMessage($member): array + { + return [ + 'id' => $member->person->uuid, + 'first_name' => $member->person->first_name, + 'last_name' => $member->person->last_name, + 'email' => $member->person->email, + 'group_roles' => $member->roles->pluck('name')->toArray(), + 'additional_permissions' => $member->permissions->pluck('name')->toArray(), + ]; + } +} \ No newline at end of file diff --git a/app/Modules/Group/Events/Traits/IsPublishableApplicationEvent.php b/app/Modules/Group/Events/Traits/IsPublishableGroupEvent.php similarity index 52% rename from app/Modules/Group/Events/Traits/IsPublishableApplicationEvent.php rename to app/Modules/Group/Events/Traits/IsPublishableGroupEvent.php index d7dd99242..7c229d193 100644 --- a/app/Modules/Group/Events/Traits/IsPublishableApplicationEvent.php +++ b/app/Modules/Group/Events/Traits/IsPublishableGroupEvent.php @@ -5,7 +5,7 @@ use Illuminate\Support\Str; use Illuminate\Support\Carbon; -trait IsPublishableApplicationEvent +trait IsPublishableGroupEvent { public function getLogDate(): Carbon { @@ -28,7 +28,7 @@ public function getPublishableMessage(): array 'type' => $this->group->fullType->name, ], ]; - if ($this->group->isEp()) { + if ($this->group->isEp()) { // TODO: consider moving this to IsPublisableExpertPanelEvent $message['group']['affiliation_id'] = $this->group->expertPanel->affiliation_id; $message['group']['scope_description'] = $this->group->expertPanel->scope_description; $message['group']['short_name'] = $this->group->expertPanel->short_base_name; @@ -36,44 +36,10 @@ public function getPublishableMessage(): array // $message['group']['long_base_name'] = $this->group->expertPanel->long_base_name; // $message['group']['hypothesis_group'] = $this->group->expertPanel->hypothesis_group; // $message['group']['membership_description'] = $this->group->expertPanel->membership_description; - - } - return [ - 'group' => array_merge( - [ - ], - // Conditionally add vcep field below if type is 'vcep' - $this->group->fullType->name === 'vcep' ? ['cspec_url' => $this->group->expertPanel->affiliation_id] : [], - ) - ]; - } - - - public function mapGeneForMessage($gene): array - { - $messageGene = [ - 'hgnc_id' => $gene->hgnc_id, - 'gene_symbol' => $gene->gene_symbol, - ]; - - if ($gene->mondo_id) { - $messageGene['mondo_id'] = $gene->mondo_id; - $messageGene['disease_name'] = $gene->disease_name; - $messageGene['disease_entity'] = $gene->disease_entity; + if ($this->group->fullType->name === 'vcep') { + $message['group']['cspec_url'] = $this->group->expertPanel->affiliation_id; + } } - - return $messageGene; - } - - public function mapMemberForMessage($member): array - { - return [ - 'id' => $member->person->uuid, - 'first_name' => $member->person->first_name, - 'last_name' => $member->person->last_name, - 'email' => $member->person->email, - 'group_roles' => $member->roles->pluck('name')->toArray(), - 'additional_permissions' => $member->permissions->pluck('name')->toArray(), - ]; + return $message; } } diff --git a/app/Modules/Group/Providers/GroupModuleServiceProvider.php b/app/Modules/Group/Providers/GroupModuleServiceProvider.php index 4f8c3179e..cb80acf9e 100644 --- a/app/Modules/Group/Providers/GroupModuleServiceProvider.php +++ b/app/Modules/Group/Providers/GroupModuleServiceProvider.php @@ -21,7 +21,7 @@ use App\Modules\Group\Events\ApplicationStepSubmitted; use App\Modules\ExpertPanel\Events\ApplicationCompleted; use App\Modules\Group\Actions\ApplicationSnapshotCreate; -use App\Modules\Group\Events\PublishableApplicationEvent; +use App\Modules\Group\Events\PublishableExpertPanelEvent; use App\Modules\Group\Events\ApplicationRevisionsRequested; use App\Modules\Group\Actions\ApplicationSubmissionReceiptSend; use App\Modules\Group\Actions\NextActionReviewSubmissionComplete; From 3e74bae06f261b1f0e68f9bc179e5de9ac34f11b Mon Sep 17 00:00:00 2001 From: Bradford Powell Date: Tue, 17 Dec 2024 15:36:29 -0500 Subject: [PATCH 08/21] more renaming to reflect reality of newer conceptual model (and avoid overloaded "application") --- app/Modules/ExpertPanel/Events/ApplicationCompleted.php | 6 +++--- app/Modules/ExpertPanel/Events/ApplicationInitiated.php | 6 +++--- app/Modules/ExpertPanel/Events/ContactAdded.php | 2 +- app/Modules/ExpertPanel/Events/ContactRemoved.php | 2 +- app/Modules/ExpertPanel/Events/DocumentAdded.php | 2 +- app/Modules/ExpertPanel/Events/DocumentDeleted.php | 2 +- app/Modules/ExpertPanel/Events/DocumentInfoUpdated.php | 2 +- app/Modules/ExpertPanel/Events/DocumentMarkedFinal.php | 2 +- app/Modules/ExpertPanel/Events/ExpertPanelDeleted.php | 2 +- app/Modules/ExpertPanel/Events/ExpertPanelEvent.php | 8 ++++---- app/Modules/ExpertPanel/Events/NextActionAdded.php | 2 +- app/Modules/ExpertPanel/Events/NextActionCompleted.php | 2 +- app/Modules/ExpertPanel/Events/NextActionUpdated.php | 2 +- .../ExpertPanel/Events/SpecificationStatusUpdated.php | 2 +- app/Modules/ExpertPanel/Events/StepApproved.php | 4 ++-- .../ExpertPanel/Events/StepDateApprovedUpdated.php | 6 +++--- app/Modules/Group/Actions/GroupStatusUpdate.php | 2 +- 17 files changed, 27 insertions(+), 27 deletions(-) diff --git a/app/Modules/ExpertPanel/Events/ApplicationCompleted.php b/app/Modules/ExpertPanel/Events/ApplicationCompleted.php index f27cc9a81..563a51c89 100644 --- a/app/Modules/ExpertPanel/Events/ApplicationCompleted.php +++ b/app/Modules/ExpertPanel/Events/ApplicationCompleted.php @@ -21,7 +21,7 @@ class ApplicationCompleted extends ExpertPanelEvent * * @return void */ - public function __construct(public ExpertPanel $application) + public function __construct(public ExpertPanel $expertPanel) { } @@ -33,12 +33,12 @@ public function getLogEntry():string public function getLogDate():Carbon { - return $this->application->date_completed; + return $this->expertPanel->date_completed; } public function getProperties():array { - return ['date_completed' => $this->application->date_completed]; + return ['date_completed' => $this->expertPanel->date_completed]; } diff --git a/app/Modules/ExpertPanel/Events/ApplicationInitiated.php b/app/Modules/ExpertPanel/Events/ApplicationInitiated.php index aef44c39c..5d8f684b5 100644 --- a/app/Modules/ExpertPanel/Events/ApplicationInitiated.php +++ b/app/Modules/ExpertPanel/Events/ApplicationInitiated.php @@ -14,13 +14,13 @@ class ApplicationInitiated extends ExpertPanelEvent use Dispatchable, InteractsWithSockets, SerializesModels; public function __construct( - public ExpertPanel $application + public ExpertPanel $expertPanel ) {} public function getProperties():array { - return $this->application->getAttributes(); + return $this->expertPanel->getAttributes(); } public function getLogEntry():string @@ -30,7 +30,7 @@ public function getLogEntry():string public function getLogDate():Carbon { - return $this->application->date_initiated; + return $this->expertPanel->date_initiated; } public function getStep() diff --git a/app/Modules/ExpertPanel/Events/ContactAdded.php b/app/Modules/ExpertPanel/Events/ContactAdded.php index b91554d05..e14c39e3c 100644 --- a/app/Modules/ExpertPanel/Events/ContactAdded.php +++ b/app/Modules/ExpertPanel/Events/ContactAdded.php @@ -21,7 +21,7 @@ class ContactAdded extends ExpertPanelEvent * * @return void */ - public function __construct(public ExpertPanel $application, public Person $person) + public function __construct(public ExpertPanel $expertPanel, public Person $person) {} public function getLogEntry():string diff --git a/app/Modules/ExpertPanel/Events/ContactRemoved.php b/app/Modules/ExpertPanel/Events/ContactRemoved.php index 5fd0fc797..52edc24e3 100644 --- a/app/Modules/ExpertPanel/Events/ContactRemoved.php +++ b/app/Modules/ExpertPanel/Events/ContactRemoved.php @@ -22,7 +22,7 @@ class ContactRemoved extends ExpertPanelEvent * * @return void */ - public function __construct(public ExpertPanel $application, public Person $person) + public function __construct(public ExpertPanel $expertPanel, public Person $person) { // } diff --git a/app/Modules/ExpertPanel/Events/DocumentAdded.php b/app/Modules/ExpertPanel/Events/DocumentAdded.php index 4a661103e..9b40f42ba 100644 --- a/app/Modules/ExpertPanel/Events/DocumentAdded.php +++ b/app/Modules/ExpertPanel/Events/DocumentAdded.php @@ -24,7 +24,7 @@ class DocumentAdded extends ExpertPanelEvent * @return void */ public function __construct( - public ExpertPanel $application, + public ExpertPanel $expertPanel, public Document $document ) { // diff --git a/app/Modules/ExpertPanel/Events/DocumentDeleted.php b/app/Modules/ExpertPanel/Events/DocumentDeleted.php index 8b629395a..9e54767e3 100644 --- a/app/Modules/ExpertPanel/Events/DocumentDeleted.php +++ b/app/Modules/ExpertPanel/Events/DocumentDeleted.php @@ -21,7 +21,7 @@ class DocumentDeleted extends ExpertPanelEvent * * @return void */ - public function __construct(public ExpertPanel $application, public Document $document) + public function __construct(public ExpertPanel $expertPanel, public Document $document) { // } diff --git a/app/Modules/ExpertPanel/Events/DocumentInfoUpdated.php b/app/Modules/ExpertPanel/Events/DocumentInfoUpdated.php index 8831f0e34..a09a97287 100644 --- a/app/Modules/ExpertPanel/Events/DocumentInfoUpdated.php +++ b/app/Modules/ExpertPanel/Events/DocumentInfoUpdated.php @@ -21,7 +21,7 @@ class DocumentInfoUpdated extends ExpertPanelEvent * * @return void */ - public function __construct(public ExpertPanel $application, public Document $document) + public function __construct(public ExpertPanel $expertPanel, public Document $document) { } diff --git a/app/Modules/ExpertPanel/Events/DocumentMarkedFinal.php b/app/Modules/ExpertPanel/Events/DocumentMarkedFinal.php index 9aa66325a..c107329e1 100644 --- a/app/Modules/ExpertPanel/Events/DocumentMarkedFinal.php +++ b/app/Modules/ExpertPanel/Events/DocumentMarkedFinal.php @@ -21,7 +21,7 @@ class DocumentMarkedFinal extends ExpertPanelEvent * * @return void */ - public function __construct(public ExpertPanel $application, public Document $document) + public function __construct(public ExpertPanel $expertPanel, public Document $document) { // } diff --git a/app/Modules/ExpertPanel/Events/ExpertPanelDeleted.php b/app/Modules/ExpertPanel/Events/ExpertPanelDeleted.php index 1bae378c2..382cf4f79 100644 --- a/app/Modules/ExpertPanel/Events/ExpertPanelDeleted.php +++ b/app/Modules/ExpertPanel/Events/ExpertPanelDeleted.php @@ -13,7 +13,7 @@ class ExpertPanelDeleted extends ExpertPanelEvent use Dispatchable, InteractsWithSockets, SerializesModels; public function __construct( - public ExpertPanel $application + public ExpertPanel $expertPanel ) { } diff --git a/app/Modules/ExpertPanel/Events/ExpertPanelEvent.php b/app/Modules/ExpertPanel/Events/ExpertPanelEvent.php index 164270fad..5454e6868 100644 --- a/app/Modules/ExpertPanel/Events/ExpertPanelEvent.php +++ b/app/Modules/ExpertPanel/Events/ExpertPanelEvent.php @@ -17,7 +17,7 @@ abstract class ExpertPanelEvent extends RecordableEvent { use Dispatchable, InteractsWithSockets, SerializesModels; - public function __construct(public ExpertPanel $application) + public function __construct(public ExpertPanel $expertPanel) { } @@ -33,7 +33,7 @@ public function hasSubject():bool public function getSubject():Model { - return $this->application->group; + return $this->expertPanel->group; } public function getLogDate():Carbon @@ -43,7 +43,7 @@ public function getLogDate():Carbon public function getStep() { - return $this->application->current_step; + return $this->expertPanel->current_step; } /** @@ -64,6 +64,6 @@ public function shouldPublish(): bool public function __get($key) { - return $key == 'group' ? $this->application->group : null; + return $key == 'group' ? $this->expertPanel->group : null; } } diff --git a/app/Modules/ExpertPanel/Events/NextActionAdded.php b/app/Modules/ExpertPanel/Events/NextActionAdded.php index cbde0f173..5a743deb9 100644 --- a/app/Modules/ExpertPanel/Events/NextActionAdded.php +++ b/app/Modules/ExpertPanel/Events/NextActionAdded.php @@ -22,7 +22,7 @@ class NextActionAdded extends ExpertPanelEvent * * @return void */ - public function __construct(public ExpertPanel $application, public NextAction $nextAction) + public function __construct(public ExpertPanel $expertPanel, public NextAction $nextAction) { } diff --git a/app/Modules/ExpertPanel/Events/NextActionCompleted.php b/app/Modules/ExpertPanel/Events/NextActionCompleted.php index b3fd4222c..b7b285160 100644 --- a/app/Modules/ExpertPanel/Events/NextActionCompleted.php +++ b/app/Modules/ExpertPanel/Events/NextActionCompleted.php @@ -22,7 +22,7 @@ class NextActionCompleted extends ExpertPanelEvent * * @return void */ - public function __construct(public ExpertPanel $application, public NextAction $nextAction) + public function __construct(public ExpertPanel $expertPanel, public NextAction $nextAction) { // } diff --git a/app/Modules/ExpertPanel/Events/NextActionUpdated.php b/app/Modules/ExpertPanel/Events/NextActionUpdated.php index a37baabe9..f0a490baf 100644 --- a/app/Modules/ExpertPanel/Events/NextActionUpdated.php +++ b/app/Modules/ExpertPanel/Events/NextActionUpdated.php @@ -22,7 +22,7 @@ class NextActionUpdated extends ExpertPanelEvent * * @return void */ - public function __construct(public ExpertPanel $application, public NextAction $nextAction, public array $oldData) + public function __construct(public ExpertPanel $expertPanel, public NextAction $nextAction, public array $oldData) { } diff --git a/app/Modules/ExpertPanel/Events/SpecificationStatusUpdated.php b/app/Modules/ExpertPanel/Events/SpecificationStatusUpdated.php index e7fa052ca..9a9db7751 100644 --- a/app/Modules/ExpertPanel/Events/SpecificationStatusUpdated.php +++ b/app/Modules/ExpertPanel/Events/SpecificationStatusUpdated.php @@ -22,7 +22,7 @@ class SpecificationStatusUpdated extends ExpertPanelEvent * * @return void */ - public function __construct(public ExpertPanel $application, public Specification $specification ) + public function __construct(public ExpertPanel $expertPanel, public Specification $specification ) { } diff --git a/app/Modules/ExpertPanel/Events/StepApproved.php b/app/Modules/ExpertPanel/Events/StepApproved.php index 75de6b2e4..ba959799e 100644 --- a/app/Modules/ExpertPanel/Events/StepApproved.php +++ b/app/Modules/ExpertPanel/Events/StepApproved.php @@ -23,7 +23,7 @@ class StepApproved extends ExpertPanelEvent implements PublishableExpertPanelEve * * @return void */ - public function __construct(public ExpertPanel $application, public int $step, public Carbon $dateApproved) + public function __construct(public ExpertPanel $expertPanel, public int $step, public Carbon $dateApproved) { // } @@ -47,7 +47,7 @@ public function getLogDate():Carbon public function getStep() { - return max(($this->application->current_step - 1), 1); + return max(($this->expertPanel->current_step - 1), 1); } public function getEventType(): string diff --git a/app/Modules/ExpertPanel/Events/StepDateApprovedUpdated.php b/app/Modules/ExpertPanel/Events/StepDateApprovedUpdated.php index fe8b472f1..89b3daedb 100644 --- a/app/Modules/ExpertPanel/Events/StepDateApprovedUpdated.php +++ b/app/Modules/ExpertPanel/Events/StepDateApprovedUpdated.php @@ -21,7 +21,7 @@ class StepDateApprovedUpdated extends ExpertPanelEvent implements PublishableExp * * @return void */ - public function __construct(public ExpertPanel $application, public int $step, public string $dateApproved) + public function __construct(public ExpertPanel $expertPanel, public int $step, public string $dateApproved) { } @@ -33,10 +33,10 @@ public function getLogEntry():string public function getProperties():array { return [ - 'application_uuid' => $this->application->uuid, + 'application_uuid' => $this->expertPanel->uuid, 'step' => $this->step, 'new_date_approved' => $this->dateApproved, - 'old_approval_date' => $this->application->getOriginal('step_'.$this->step.'_approval_date') + 'old_approval_date' => $this->expertPanel->getOriginal('step_'.$this->step.'_approval_date') ]; } diff --git a/app/Modules/Group/Actions/GroupStatusUpdate.php b/app/Modules/Group/Actions/GroupStatusUpdate.php index e57919575..f7ac02ad7 100644 --- a/app/Modules/Group/Actions/GroupStatusUpdate.php +++ b/app/Modules/Group/Actions/GroupStatusUpdate.php @@ -34,7 +34,7 @@ public function handle(Group $group, GroupStatus $groupStatus): Group public function asListener(ApplicationCompleted $event) { $activeStatus = GroupStatus::find(config('groups.statuses.active.id')); - $this->handle($event->application->group, $activeStatus); + $this->handle($event->expertPanel->group, $activeStatus); } public function asController(ActionRequest $request, Group $group) From 11dcdda00bc316892480f89b506cf591dc360abd Mon Sep 17 00:00:00 2001 From: Bradford Powell Date: Tue, 17 Dec 2024 15:53:52 -0500 Subject: [PATCH 09/21] call magic method properly --- app/Modules/Group/Events/Traits/IsPublishableGroupEvent.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Modules/Group/Events/Traits/IsPublishableGroupEvent.php b/app/Modules/Group/Events/Traits/IsPublishableGroupEvent.php index 7c229d193..7d84c9ed0 100644 --- a/app/Modules/Group/Events/Traits/IsPublishableGroupEvent.php +++ b/app/Modules/Group/Events/Traits/IsPublishableGroupEvent.php @@ -28,7 +28,7 @@ public function getPublishableMessage(): array 'type' => $this->group->fullType->name, ], ]; - if ($this->group->isEp()) { // TODO: consider moving this to IsPublisableExpertPanelEvent + if ($this->group->isEp) { // TODO: consider moving this to IsPublishableExpertPanelEvent $message['group']['affiliation_id'] = $this->group->expertPanel->affiliation_id; $message['group']['scope_description'] = $this->group->expertPanel->scope_description; $message['group']['short_name'] = $this->group->expertPanel->short_base_name; From d1d357ffc8ed0248648d2369280c704b3cc0b2f3 Mon Sep 17 00:00:00 2001 From: Bradford Powell Date: Thu, 30 Jan 2025 10:47:23 -0500 Subject: [PATCH 10/21] publish "non-expert-panel" events from the outset (since there is no formal approval process for WGs) --- .../ExpertPanel/Events/ExpertPanelAttributesUpdated.php | 5 ++--- app/Modules/Group/Events/GroupMemberEvent.php | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/Modules/ExpertPanel/Events/ExpertPanelAttributesUpdated.php b/app/Modules/ExpertPanel/Events/ExpertPanelAttributesUpdated.php index 5176835b2..4e2f035dc 100644 --- a/app/Modules/ExpertPanel/Events/ExpertPanelAttributesUpdated.php +++ b/app/Modules/ExpertPanel/Events/ExpertPanelAttributesUpdated.php @@ -50,9 +50,8 @@ public function getEventType(): string */ public function shouldPublish(): bool { - // FIXME: allow WG events to be published - return parent::shouldPublish() - && $this->expertPanel->definitionIsApproved; + // FIXME: rethink when refactoring "expert panel" predicate. Should probably have separate "should publish" predicate + return parent::shouldPublish() && (($this->expertPanel === null) || $this->expertPanel->isApproved); } /** diff --git a/app/Modules/Group/Events/GroupMemberEvent.php b/app/Modules/Group/Events/GroupMemberEvent.php index 96a87ba21..2c866e041 100644 --- a/app/Modules/Group/Events/GroupMemberEvent.php +++ b/app/Modules/Group/Events/GroupMemberEvent.php @@ -39,9 +39,8 @@ public function getPublishableMessage(): array */ public function shouldPublish(): bool { - // FIXME: allow WG events to be published - return parent::shouldPublish() - && $this->group->expertPanel->definitionIsApproved; + // FIXME: rethink when refactoring "expert panel" predicate. Should probably have separate "should publish" predicate + return parent::shouldPublish() && (($this->expertPanel === null) || $this->expertPanel->isApproved); } } From fcf1d3fb837df553fb25e821143ab53cce30fd9d Mon Sep 17 00:00:00 2001 From: Bradford Powell Date: Mon, 3 Feb 2025 09:38:55 -0500 Subject: [PATCH 11/21] publish events from non-EP groups data, e.g., from CDWGs and AWGs are needed for website. For EPs, still don't publish until approved. Non-EPs have no approval process, so can just publish as soon as created. IMPORTANT: need to check on impact for CGSP-800 before moving to production. --- .../ExpertPanel/Events/ExpertPanelAttributesUpdated.php | 9 --------- app/Modules/Group/Events/GeneEvent.php | 8 -------- app/Modules/Group/Events/GroupEvent.php | 2 +- app/Modules/Group/Events/GroupMemberEvent.php | 3 ++- 4 files changed, 3 insertions(+), 19 deletions(-) diff --git a/app/Modules/ExpertPanel/Events/ExpertPanelAttributesUpdated.php b/app/Modules/ExpertPanel/Events/ExpertPanelAttributesUpdated.php index 4e2f035dc..3a1934802 100644 --- a/app/Modules/ExpertPanel/Events/ExpertPanelAttributesUpdated.php +++ b/app/Modules/ExpertPanel/Events/ExpertPanelAttributesUpdated.php @@ -45,15 +45,6 @@ public function getEventType(): string return 'ep_info_updated'; } - /** - * For PublishableEvent interface that is applied to many sub-classes - */ - public function shouldPublish(): bool - { - // FIXME: rethink when refactoring "expert panel" predicate. Should probably have separate "should publish" predicate - return parent::shouldPublish() && (($this->expertPanel === null) || $this->expertPanel->isApproved); - } - /** * Get the channels the event should broadcast on. * diff --git a/app/Modules/Group/Events/GeneEvent.php b/app/Modules/Group/Events/GeneEvent.php index f064ad189..89a1fcbd5 100644 --- a/app/Modules/Group/Events/GeneEvent.php +++ b/app/Modules/Group/Events/GeneEvent.php @@ -11,12 +11,4 @@ abstract class GeneEvent extends GroupEvent implements GeneEventInterface, Publi getPublishableMessage as protected getBaseMessage; } - /** - * For PublishableEvent interface that is applied to many sub-classes - */ - public function shouldPublish(): bool - { - return parent::shouldPublish() - && $this->group->expertPanel->definitionIsApproved; - } } diff --git a/app/Modules/Group/Events/GroupEvent.php b/app/Modules/Group/Events/GroupEvent.php index b95ec364b..554f38d4f 100644 --- a/app/Modules/Group/Events/GroupEvent.php +++ b/app/Modules/Group/Events/GroupEvent.php @@ -62,7 +62,7 @@ public function getTopic(): string */ public function shouldPublish(): bool { - return $this->group->isEp; + return !$this->group->isEp || $this->group->expertPanel->isApproved(); } abstract public function getLogEntry() :string; diff --git a/app/Modules/Group/Events/GroupMemberEvent.php b/app/Modules/Group/Events/GroupMemberEvent.php index 2c866e041..18b9b4be7 100644 --- a/app/Modules/Group/Events/GroupMemberEvent.php +++ b/app/Modules/Group/Events/GroupMemberEvent.php @@ -40,7 +40,8 @@ public function getPublishableMessage(): array public function shouldPublish(): bool { // FIXME: rethink when refactoring "expert panel" predicate. Should probably have separate "should publish" predicate - return parent::shouldPublish() && (($this->expertPanel === null) || $this->expertPanel->isApproved); + // right now, this doesn't really override anything, but preserving for future handling of private groups (CGSP-800) + return parent::shouldPublish(); } } From e4a35df24279ecc8339c0ec77f2bf75deb98555b Mon Sep 17 00:00:00 2001 From: Bradford Powell Date: Mon, 3 Feb 2025 12:36:05 -0500 Subject: [PATCH 12/21] refactor base representation of group for DX messages to Group model --- .../Events/Traits/IsPublishableGroupEvent.php | 24 ++--------------- app/Modules/Group/Models/Group.php | 26 +++++++++++++++++++ 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/app/Modules/Group/Events/Traits/IsPublishableGroupEvent.php b/app/Modules/Group/Events/Traits/IsPublishableGroupEvent.php index 7d84c9ed0..f258319f3 100644 --- a/app/Modules/Group/Events/Traits/IsPublishableGroupEvent.php +++ b/app/Modules/Group/Events/Traits/IsPublishableGroupEvent.php @@ -4,6 +4,7 @@ use Illuminate\Support\Str; use Illuminate\Support\Carbon; +use App\Modules\Group\Models\Group; trait IsPublishableGroupEvent { @@ -19,27 +20,6 @@ public function getEventType(): string public function getPublishableMessage(): array { - $message = [ - 'group' => [ - 'id' => $this->group->uuid, - 'name' => $this->group->name, - 'status' => $this->group->groupStatus->name, - 'parent_group' => $this->group->parentGroup?->name, // TODO: check representation when no parent: null or empty string? - 'type' => $this->group->fullType->name, - ], - ]; - if ($this->group->isEp) { // TODO: consider moving this to IsPublishableExpertPanelEvent - $message['group']['affiliation_id'] = $this->group->expertPanel->affiliation_id; - $message['group']['scope_description'] = $this->group->expertPanel->scope_description; - $message['group']['short_name'] = $this->group->expertPanel->short_base_name; - // TODO: not sure about these fields - // $message['group']['long_base_name'] = $this->group->expertPanel->long_base_name; - // $message['group']['hypothesis_group'] = $this->group->expertPanel->hypothesis_group; - // $message['group']['membership_description'] = $this->group->expertPanel->membership_description; - if ($this->group->fullType->name === 'vcep') { - $message['group']['cspec_url'] = $this->group->expertPanel->affiliation_id; - } - } - return $message; + return ['group' => $this->group->representationForDataExchange()]; } } diff --git a/app/Modules/Group/Models/Group.php b/app/Modules/Group/Models/Group.php index 463a972f2..e87fe534f 100644 --- a/app/Modules/Group/Models/Group.php +++ b/app/Modules/Group/Models/Group.php @@ -284,4 +284,30 @@ public function parentGroup(): BelongsTo { return $this->belongsTo(Group::class, 'parent_id', 'id'); } + + public function representationForDataExchange(): array { + $item = [ + 'id' => $this->uuid, + 'name' => $this->name, + 'status' => $this->groupStatus->name, + 'type' => $this->type->name, + ]; + if ($this->parent != null) { + $item['parent_group'] = $this->parent->representationForDataExchange(); + } + if ($this->isEp) { + $item['ep_id'] = $this->expertPanel->uuid; + $item['affiliation_id'] = $this->expertPanel->affiliation_id; + $item['scope_description'] = $this->expertPanel->scope_description; + $item['short_name'] = $this->expertPanel->short_base_name; + // TODO: not sure about these fields + // $item['long_base_name'] = $this->expertPanel->long_base_name; + // $item['hypothesis_group'] = $this->expertPanel->hypothesis_group; + // $item['membership_description'] = $this->expertPanel->membership_description; + if ($this->fullType->name === 'vcep') { + $item['cspec_url'] = $this->expertPanel->affiliation_id; + } + } + return $item; + } } From 39a9db8b511d9188caa9275f444b82902b7f736a Mon Sep 17 00:00:00 2001 From: Bradford Powell Date: Mon, 3 Feb 2025 12:36:27 -0500 Subject: [PATCH 13/21] remove redundant parentGroup there was already a parent BelongsTo... --- app/Modules/Group/Models/Group.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/Modules/Group/Models/Group.php b/app/Modules/Group/Models/Group.php index e87fe534f..113b71c4e 100644 --- a/app/Modules/Group/Models/Group.php +++ b/app/Modules/Group/Models/Group.php @@ -280,11 +280,6 @@ protected static function newFactory() return new GroupFactory(); } - public function parentGroup(): BelongsTo - { - return $this->belongsTo(Group::class, 'parent_id', 'id'); - } - public function representationForDataExchange(): array { $item = [ 'id' => $this->uuid, From 644e362a5d302d95d315cb1092bed3a4e9d5464e Mon Sep 17 00:00:00 2001 From: Bradford Powell Date: Mon, 3 Feb 2025 12:59:00 -0500 Subject: [PATCH 14/21] update test for newer message format --- .../DX/MessageFactories/DxMessageFactoryTest.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/Unit/DX/MessageFactories/DxMessageFactoryTest.php b/tests/Unit/DX/MessageFactories/DxMessageFactoryTest.php index ca5037145..e1a3164d2 100644 --- a/tests/Unit/DX/MessageFactories/DxMessageFactoryTest.php +++ b/tests/Unit/DX/MessageFactories/DxMessageFactoryTest.php @@ -34,6 +34,8 @@ class DxMessageFactoryTest extends TestCase { use RefreshDatabase; + private ExpertPanel $expertPanel; + private DxMessageFactory $factory; public function setup():void { @@ -148,7 +150,7 @@ public function it_creates_a_member_removed_event() /** * @test */ - public function it_creates_a_member_retireded_event() + public function it_creates_a_member_retired_event() { $event = new MemberRetired($this->expertPanel->group->members->first()); @@ -161,7 +163,7 @@ public function it_creates_a_member_retireded_event() /** * @test */ - public function it_creates_a_member_unretireded_event() + public function it_creates_a_member_unretired_event() { $event = new MemberUnretired($this->expertPanel->group->members->first()); @@ -232,11 +234,9 @@ private function assertMembersInMessage($members, $message) private function assertExpertPanelInMessage($message) { - $this->assertEquals([ - 'id' => $this->expertPanel->group->uuid, - 'name' => $this->expertPanel->group->displayName, - 'type' => $this->expertPanel->group->fullType->name, - 'affiliation_id' => $this->expertPanel->affiliation_id - ], $message['data']['expert_panel']); + $g = $message['data']['group']; + $this->assertEquals($g['id'], $this->expertPanel->group->uuid); + $this->assertEquals($g['name'], $this->expertPanel->group->name); + $this->assertEquals($g['affiliation_id'], $this->expertPanel->affiliation_id); } } From 2276f634d269860197c9ea5097dee9cbb8ed4a32 Mon Sep 17 00:00:00 2001 From: Bradford Powell Date: Mon, 3 Feb 2025 14:20:57 -0500 Subject: [PATCH 15/21] publish scope description updated messages --- .../Group/Events/ScopeDescriptionUpdated.php | 7 +++-- docker-compose.yml | 2 +- phpunit.xml | 26 +++++++++---------- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/app/Modules/Group/Events/ScopeDescriptionUpdated.php b/app/Modules/Group/Events/ScopeDescriptionUpdated.php index 792d0cd44..cce2cdc56 100644 --- a/app/Modules/Group/Events/ScopeDescriptionUpdated.php +++ b/app/Modules/Group/Events/ScopeDescriptionUpdated.php @@ -2,15 +2,18 @@ namespace App\Modules\Group\Events; +use App\Modules\Group\Events\Traits\IsPublishableExpertPanelEvent; use Illuminate\Queue\SerializesModels; use Illuminate\Broadcasting\PrivateChannel; use App\Modules\Group\Models\Group; use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Broadcasting\InteractsWithSockets; -class ScopeDescriptionUpdated extends GroupEvent +// TODO: should probably extend ExpertPanelEvent, since only EPs have scope descriptions. +// or else, descriptions should be added to other groups... +class ScopeDescriptionUpdated extends GroupEvent implements PublishableExpertPanelEvent { - use Dispatchable, InteractsWithSockets, SerializesModels; + use Dispatchable, InteractsWithSockets, SerializesModels, IsPublishableExpertPanelEvent; /** * Create a new event instance. diff --git a/docker-compose.yml b/docker-compose.yml index f3182b684..7745fc589 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -45,7 +45,7 @@ services: HOME: /srv/app DB_HOST: ${DOCKER_NAME:-gpm}-db REDIS_HOST: ${DOCKER_NAME:-gpm}-redis - SANCTUM_STATEFUL_DOMAINS: localhost:${APP_PORT:-8013},127.0.0.1:${APP_PORT:-8013} + SANCTUM_STATEFUL_DOMAINS: localhost:${APP_PORT:-8013},127.0.0.1:${APP_PORT:-8013},127.0.0.1,localhost XDEBUG_MODE: ${XDEBUG_MODE:-debug,develop} XDEBUG_CONFIG: ${XDEBUG_SESSION:-client_host=host.docker.internal} user: ${DOCKER_USER:-501:20} diff --git a/phpunit.xml b/phpunit.xml index bfbcf20d2..ad8b99b66 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -24,18 +24,18 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + From 2f8027b0345e4bc4a0f3e7f1d78c53a9ef1aee06 Mon Sep 17 00:00:00 2001 From: Bradford Powell Date: Mon, 3 Feb 2025 18:07:59 -0500 Subject: [PATCH 16/21] trying to be extra sure to use memory db for testing --- phpunit.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/phpunit.xml b/phpunit.xml index ad8b99b66..750f70c29 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -37,5 +37,6 @@ + From 358824e8528d46571f70b53ee132093075e0c44e Mon Sep 17 00:00:00 2001 From: Bradford Powell Date: Mon, 3 Feb 2025 20:02:27 -0500 Subject: [PATCH 17/21] lots of cleanup related to description and application->expertPanel --- .../Commands/Dev/FixupCSpecApprovalDates.php | 2 +- .../Actions/ApplicationDocumentAdd.php | 2 +- .../Actions/CompleteNextAction.php | 2 +- .../ExpertPanel/Actions/ExpertPanelDelete.php | 2 +- .../Actions/NextActionComplete.php | 2 +- .../ExpertPanel/Actions/NextActionUpdate.php | 2 +- .../Actions/SpecificationAndRulesetsSync.php | 2 +- .../Actions/StepApprovalUpdate.php | 2 +- .../ExpertPanel/Actions/StepApprove.php | 2 +- .../Events/ExpertPanelAttributesUpdated.php | 1 + .../Events/NextActionCompleted.php | 4 ---- .../ExpertPanel/Events/StepApproved.php | 2 +- .../ExpertPanel/Models/ExpertPanel.php | 6 +++++- .../Group/Actions/ApplicationSaveChanges.php | 4 ++-- ...nUpdate.php => GroupDescriptionUpdate.php} | 21 +++++++------------ .../NextActionReviewSubmissionComplete.php | 5 +---- ...pdated.php => GroupDescriptionUpdated.php} | 9 ++++---- app/Modules/Group/Events/GroupEvent.php | 2 +- app/Modules/Group/Models/Group.php | 3 ++- app/Modules/Group/routes/api.php | 6 ++++-- 20 files changed, 38 insertions(+), 43 deletions(-) rename app/Modules/Group/Actions/{ScopeDescriptionUpdate.php => GroupDescriptionUpdate.php} (62%) rename app/Modules/Group/Events/{ScopeDescriptionUpdated.php => GroupDescriptionUpdated.php} (74%) diff --git a/app/Console/Commands/Dev/FixupCSpecApprovalDates.php b/app/Console/Commands/Dev/FixupCSpecApprovalDates.php index cf395684c..7cb3c2162 100644 --- a/app/Console/Commands/Dev/FixupCSpecApprovalDates.php +++ b/app/Console/Commands/Dev/FixupCSpecApprovalDates.php @@ -70,7 +70,7 @@ private function updateStepForAllApplications($step, $eventName) $expertPanel->save(); Event::dispatch( new StepDateApprovedUpdated( - application: $expertPanel, + expertPanel: $expertPanel, step: $step, dateApproved: $dateApproved ) diff --git a/app/Modules/ExpertPanel/Actions/ApplicationDocumentAdd.php b/app/Modules/ExpertPanel/Actions/ApplicationDocumentAdd.php index 3d1eecd3e..3a1ad8144 100644 --- a/app/Modules/ExpertPanel/Actions/ApplicationDocumentAdd.php +++ b/app/Modules/ExpertPanel/Actions/ApplicationDocumentAdd.php @@ -50,7 +50,7 @@ public function handle( $this->updateOrTouchExpertPanel($expertPanel, $document); $event = new DocumentAdded( - application: $expertPanel, + expertPanel: $expertPanel, document: $document ); Event::dispatch($event); diff --git a/app/Modules/ExpertPanel/Actions/CompleteNextAction.php b/app/Modules/ExpertPanel/Actions/CompleteNextAction.php index 256a5fd83..f4b72197a 100644 --- a/app/Modules/ExpertPanel/Actions/CompleteNextAction.php +++ b/app/Modules/ExpertPanel/Actions/CompleteNextAction.php @@ -36,6 +36,6 @@ public function handle() $nextAction->save(); $expertPanel->touch(); - Event::dispatch(new NextActionCompleted(application: $expertPanel, nextAction: $nextAction)); + Event::dispatch(new NextActionCompleted(expertPanel: $expertPanel, nextAction: $nextAction)); } } diff --git a/app/Modules/ExpertPanel/Actions/ExpertPanelDelete.php b/app/Modules/ExpertPanel/Actions/ExpertPanelDelete.php index da986b7d1..f7e3e6d13 100644 --- a/app/Modules/ExpertPanel/Actions/ExpertPanelDelete.php +++ b/app/Modules/ExpertPanel/Actions/ExpertPanelDelete.php @@ -15,6 +15,6 @@ public function handle(String $expertPanelUuid) $expertPanel = ExpertPanel::findByUuidOrFail($expertPanelUuid); $expertPanel->delete(); - event(new ExpertPanelDeleted(application: $expertPanel)); + event(new ExpertPanelDeleted(expertPanel: $expertPanel)); } } diff --git a/app/Modules/ExpertPanel/Actions/NextActionComplete.php b/app/Modules/ExpertPanel/Actions/NextActionComplete.php index f13138276..9871d622f 100644 --- a/app/Modules/ExpertPanel/Actions/NextActionComplete.php +++ b/app/Modules/ExpertPanel/Actions/NextActionComplete.php @@ -19,7 +19,7 @@ public function handle(ExpertPanel $expertPanel, NextAction $nextAction, ?string $nextAction->save(); $expertPanel->touch(); - Event::dispatch(new NextActionCompleted(application: $expertPanel, nextAction: $nextAction)); + Event::dispatch(new NextActionCompleted(expertPanel: $expertPanel, nextAction: $nextAction)); return $nextAction; } diff --git a/app/Modules/ExpertPanel/Actions/NextActionUpdate.php b/app/Modules/ExpertPanel/Actions/NextActionUpdate.php index 0846150dc..b4ea25620 100644 --- a/app/Modules/ExpertPanel/Actions/NextActionUpdate.php +++ b/app/Modules/ExpertPanel/Actions/NextActionUpdate.php @@ -46,7 +46,7 @@ public function handle( DB::transaction(fn () => $nextAction->save()); $nextAction->update($data); - event(new NextActionUpdated(application: $expertPanel, nextAction: $nextAction, oldData: $oldData)); + event(new NextActionUpdated(expertPanel: $expertPanel, nextAction: $nextAction, oldData: $oldData)); return $nextAction->load('assignee'); } diff --git a/app/Modules/ExpertPanel/Actions/SpecificationAndRulesetsSync.php b/app/Modules/ExpertPanel/Actions/SpecificationAndRulesetsSync.php index e26bb8948..924b41950 100644 --- a/app/Modules/ExpertPanel/Actions/SpecificationAndRulesetsSync.php +++ b/app/Modules/ExpertPanel/Actions/SpecificationAndRulesetsSync.php @@ -39,7 +39,7 @@ public function handle( } event(new SpecificationStatusUpdated( - application: $expertPanel, + expertPanel: $expertPanel, specification: $specification, )); diff --git a/app/Modules/ExpertPanel/Actions/StepApprovalUpdate.php b/app/Modules/ExpertPanel/Actions/StepApprovalUpdate.php index 49dccdb93..3a162ee40 100644 --- a/app/Modules/ExpertPanel/Actions/StepApprovalUpdate.php +++ b/app/Modules/ExpertPanel/Actions/StepApprovalUpdate.php @@ -28,7 +28,7 @@ public function handle(string $expertPanelUuid, int $step, string $dateApproved) Event::dispatch( new StepDateApprovedUpdated( - application: $expertPanel, + expertPanel: $expertPanel, step: $step, dateApproved: $dateApproved ) diff --git a/app/Modules/ExpertPanel/Actions/StepApprove.php b/app/Modules/ExpertPanel/Actions/StepApprove.php index 915500cc3..9792f90e9 100644 --- a/app/Modules/ExpertPanel/Actions/StepApprove.php +++ b/app/Modules/ExpertPanel/Actions/StepApprove.php @@ -70,7 +70,7 @@ public function handle( } event(new StepApproved( - application: $expertPanel, + expertPanel: $expertPanel, step: $approvedStep, dateApproved: $dateApproved )); diff --git a/app/Modules/ExpertPanel/Events/ExpertPanelAttributesUpdated.php b/app/Modules/ExpertPanel/Events/ExpertPanelAttributesUpdated.php index 3a1934802..038eede54 100644 --- a/app/Modules/ExpertPanel/Events/ExpertPanelAttributesUpdated.php +++ b/app/Modules/ExpertPanel/Events/ExpertPanelAttributesUpdated.php @@ -22,6 +22,7 @@ class ExpertPanelAttributesUpdated extends GroupEvent implements PublishableExpe */ public function __construct(public ExpertPanel $expertPanel, public array $attributes) { + $this->group = $expertPanel->group; // } diff --git a/app/Modules/ExpertPanel/Events/NextActionCompleted.php b/app/Modules/ExpertPanel/Events/NextActionCompleted.php index b7b285160..b6effaa7b 100644 --- a/app/Modules/ExpertPanel/Events/NextActionCompleted.php +++ b/app/Modules/ExpertPanel/Events/NextActionCompleted.php @@ -3,15 +3,11 @@ namespace App\Modules\ExpertPanel\Events; use Illuminate\Support\Carbon; -use Illuminate\Broadcasting\Channel; use Illuminate\Queue\SerializesModels; -use Illuminate\Broadcasting\PrivateChannel; -use Illuminate\Broadcasting\PresenceChannel; use App\Modules\ExpertPanel\Models\NextAction; use Illuminate\Foundation\Events\Dispatchable; use App\Modules\ExpertPanel\Models\ExpertPanel; use Illuminate\Broadcasting\InteractsWithSockets; -use Illuminate\Contracts\Broadcasting\ShouldBroadcast; class NextActionCompleted extends ExpertPanelEvent { diff --git a/app/Modules/ExpertPanel/Events/StepApproved.php b/app/Modules/ExpertPanel/Events/StepApproved.php index ba959799e..84b6f2385 100644 --- a/app/Modules/ExpertPanel/Events/StepApproved.php +++ b/app/Modules/ExpertPanel/Events/StepApproved.php @@ -76,7 +76,7 @@ public function getPublishableMessage(): array }) ->toArray(); - $message['scope']['statement'] = $this->group->expertPanel->scope_description; + $message['scope']['statement'] = $this->group->description; $message['scope']['genes'] = $this->group->expertPanel->genes ->map(function ($gene) { return $this->mapGeneForMessage($gene); diff --git a/app/Modules/ExpertPanel/Models/ExpertPanel.php b/app/Modules/ExpertPanel/Models/ExpertPanel.php index 6bd7249e7..1fccbcd87 100644 --- a/app/Modules/ExpertPanel/Models/ExpertPanel.php +++ b/app/Modules/ExpertPanel/Models/ExpertPanel.php @@ -57,7 +57,6 @@ class ExpertPanel extends Model implements HasNotes, HasMembers, BelongsToGroup, 'date_completed', 'hypothesis_group', 'membership_description', - 'scope_description', 'nhgri_attestation_date', 'preprint_attestation_date', 'curation_review_protocol_id', @@ -135,6 +134,7 @@ class ExpertPanel extends Model implements HasNotes, HasMembers, BelongsToGroup, 'has_approved_draft', 'has_approved_pilot', 'sustained_curation_is_approved', + 'scope_description', ]; public static function booted() @@ -468,6 +468,10 @@ public function getApprovalDateForStep($stepNumber): Carbon } + public function getScopeDescriptionAttribute() + { + return $this->group->description; + } // Factory support diff --git a/app/Modules/Group/Actions/ApplicationSaveChanges.php b/app/Modules/Group/Actions/ApplicationSaveChanges.php index 92cd2b666..bfb41db76 100644 --- a/app/Modules/Group/Actions/ApplicationSaveChanges.php +++ b/app/Modules/Group/Actions/ApplicationSaveChanges.php @@ -14,7 +14,7 @@ class ApplicationSaveChanges public function __construct( private MembershipDescriptionUpdate $memberDescription, - private ScopeDescriptionUpdate $scopeDescription, + private GroupDescriptionUpdate $groupDescription, private CurationReviewProtocolUpdate $curationReviewProtocol, private AttestationGcepStore $gcepAttestation, private AttestationNhgriStore $nhgriAttestation, @@ -29,7 +29,7 @@ public function __construct( public function handle(Group $group, $data): Group { $data = collect($data); - $group = $this->scopeDescription->handle($group, $data->get('scope_description')); + $group = $this->groupDescription->handle($group, $data->get('description')); $group = $this->curationReviewProtocol->handle($group, $data); if ($group->isGcep) { $group = $this->gcepAttestation->handle($group, $data->toArray()); diff --git a/app/Modules/Group/Actions/ScopeDescriptionUpdate.php b/app/Modules/Group/Actions/GroupDescriptionUpdate.php similarity index 62% rename from app/Modules/Group/Actions/ScopeDescriptionUpdate.php rename to app/Modules/Group/Actions/GroupDescriptionUpdate.php index 182c0d390..55bd723a9 100644 --- a/app/Modules/Group/Actions/ScopeDescriptionUpdate.php +++ b/app/Modules/Group/Actions/GroupDescriptionUpdate.php @@ -5,30 +5,25 @@ use Illuminate\Support\Facades\Auth; use Lorisleiva\Actions\ActionRequest; use Lorisleiva\Actions\Concerns\AsAction; -use Illuminate\Validation\ValidationException; use Illuminate\Auth\Access\AuthorizationException; use App\Modules\Group\Http\Resources\GroupResource; -use App\Modules\Group\Events\ScopeDescriptionUpdated; +use App\Modules\Group\Events\GroupDescriptionUpdated; -class ScopeDescriptionUpdate +class GroupDescriptionUpdate { use AsAction; public function handle(Group $group, ?string $description): Group { - if (!$group->isExpertPanel) { - throw ValidationException::withMessages(['scope_description' => ['A description of scope can only be set for expert panels.']]); - } - - if ($group->expertPanel->scope_description == $description) { + if ($group->description == $description) { return $group; } - $group->expertPanel->update([ - 'scope_description' => $description + $group->update([ + 'description' => $description ]); - event(new ScopeDescriptionUpdated($group, $description)); + event(new GroupDescriptionUpdated($group, $description)); return $group; } @@ -39,7 +34,7 @@ public function asController(ActionRequest $request, $uuid) if (Auth()->user()->cannot('updateApplicationAttribute', $group)) { throw new AuthorizationException('You do not have permission to update this Expert Panel.'); } - $group = $this->handle($group, $request->scope_description); + $group = $this->handle($group, $request->description); $group->load('expertPanel', 'members', 'members.person'); return new GroupResource($group); @@ -48,7 +43,7 @@ public function asController(ActionRequest $request, $uuid) public function rules(): array { return [ - 'scope_description' => 'required|max:66535' + 'description' => 'required|max:66535' ]; } diff --git a/app/Modules/Group/Actions/NextActionReviewSubmissionComplete.php b/app/Modules/Group/Actions/NextActionReviewSubmissionComplete.php index 0d22d504c..49ff38181 100644 --- a/app/Modules/Group/Actions/NextActionReviewSubmissionComplete.php +++ b/app/Modules/Group/Actions/NextActionReviewSubmissionComplete.php @@ -6,10 +6,7 @@ use App\Events\Event; use InvalidArgumentException; use Lorisleiva\Actions\Concerns\AsListener; -use App\Modules\ExpertPanel\Models\NextAction; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Doctrine\Common\Cache\Psr6\InvalidArgument; -use App\Modules\ExpertPanel\Events\StepApproved; use App\Modules\ExpertPanel\Actions\NextActionComplete; class NextActionReviewSubmissionComplete @@ -35,7 +32,7 @@ public function handle(ExpertPanel $expertPanel) public function asListener(Event $event): void { - $expertPanel = isset($event->application) ? $event->application : null; + $expertPanel = $event->expertPanel??null; if (!$expertPanel) { if (isset($event->submission)) { $expertPanel = $event->submission->group->expertPanel; diff --git a/app/Modules/Group/Events/ScopeDescriptionUpdated.php b/app/Modules/Group/Events/GroupDescriptionUpdated.php similarity index 74% rename from app/Modules/Group/Events/ScopeDescriptionUpdated.php rename to app/Modules/Group/Events/GroupDescriptionUpdated.php index cce2cdc56..6574b0991 100644 --- a/app/Modules/Group/Events/ScopeDescriptionUpdated.php +++ b/app/Modules/Group/Events/GroupDescriptionUpdated.php @@ -2,18 +2,17 @@ namespace App\Modules\Group\Events; -use App\Modules\Group\Events\Traits\IsPublishableExpertPanelEvent; +use App\Events\PublishableEvent; +use App\Modules\Group\Events\Traits\IsPublishableGroupEvent; use Illuminate\Queue\SerializesModels; use Illuminate\Broadcasting\PrivateChannel; use App\Modules\Group\Models\Group; use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Broadcasting\InteractsWithSockets; -// TODO: should probably extend ExpertPanelEvent, since only EPs have scope descriptions. -// or else, descriptions should be added to other groups... -class ScopeDescriptionUpdated extends GroupEvent implements PublishableExpertPanelEvent +class GroupDescriptionUpdated extends GroupEvent implements PublishableEvent { - use Dispatchable, InteractsWithSockets, SerializesModels, IsPublishableExpertPanelEvent; + use Dispatchable, InteractsWithSockets, SerializesModels, IsPublishableGroupEvent; /** * Create a new event instance. diff --git a/app/Modules/Group/Events/GroupEvent.php b/app/Modules/Group/Events/GroupEvent.php index 554f38d4f..83ce9f8bb 100644 --- a/app/Modules/Group/Events/GroupEvent.php +++ b/app/Modules/Group/Events/GroupEvent.php @@ -62,7 +62,7 @@ public function getTopic(): string */ public function shouldPublish(): bool { - return !$this->group->isEp || $this->group->expertPanel->isApproved(); + return !$this->group->isEp || $this->group->expertPanel->isApproved; } abstract public function getLogEntry() :string; diff --git a/app/Modules/Group/Models/Group.php b/app/Modules/Group/Models/Group.php index 113b71c4e..d6bb8e946 100644 --- a/app/Modules/Group/Models/Group.php +++ b/app/Modules/Group/Models/Group.php @@ -66,7 +66,8 @@ class Group extends Model implements HasNotes, HasMembers, RecordsEvents, HasDoc 'group_type_id', 'group_status_id', 'parent_id', - 'coi_code' + 'coi_code', + 'description', ]; /** diff --git a/app/Modules/Group/routes/api.php b/app/Modules/Group/routes/api.php index 095f5852c..6763343da 100644 --- a/app/Modules/Group/routes/api.php +++ b/app/Modules/Group/routes/api.php @@ -41,7 +41,7 @@ use App\Modules\Group\Actions\ApplicationSaveChanges; use App\Modules\Group\Actions\MemberGrantPermissions; use App\Modules\Group\Actions\MemberRevokePermission; -use App\Modules\Group\Actions\ScopeDescriptionUpdate; +use App\Modules\Group\Actions\GroupDescriptionUpdate; use App\Modules\ExpertPanel\Actions\SpecificationsGet; use App\Modules\Group\Actions\AttestationReanalysisStore; use App\Modules\Group\Actions\ApplicationSubmissionReject; @@ -118,6 +118,8 @@ Route::post('/dev/fake-pilot-approved', DevFakePilotApproved::class); + Route::post('/description', GroupDescriptionUpdate::class); + // DOCUMENTS Route::group(['prefix' => '/documents'], function () { Route::get('/', [GroupRelationsController::class, 'documents']); @@ -130,7 +132,7 @@ Route::put('/curation-review-protocols', CurationReviewProtocolUpdate::class); Route::put('/membership-description', MembershipDescriptionUpdate::class); Route::put('/name', ExpertPanelNameUpdate::class); - Route::put('/scope-description', ScopeDescriptionUpdate::class); + Route::put('/scope-description', GroupDescriptionUpdate::class); Route::put('/affiliation-id', ExpertPanelAffiliationIdUpdate::class); Route::put('/sustained-curation-reviews', SustainedCurationReviewComplete::class); From 11170eac70724dd28cdd16fd9edfca72b6b99894 Mon Sep 17 00:00:00 2001 From: Bradford Powell Date: Mon, 3 Feb 2025 20:23:12 -0500 Subject: [PATCH 18/21] fix ep publishing (after step *1* approval) --- app/Modules/Group/Events/GroupEvent.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Modules/Group/Events/GroupEvent.php b/app/Modules/Group/Events/GroupEvent.php index 83ce9f8bb..5aae1f753 100644 --- a/app/Modules/Group/Events/GroupEvent.php +++ b/app/Modules/Group/Events/GroupEvent.php @@ -62,7 +62,7 @@ public function getTopic(): string */ public function shouldPublish(): bool { - return !$this->group->isEp || $this->group->expertPanel->isApproved; + return !$this->group->isEp || $this->group->expertPanel->definitionIsApproved; } abstract public function getLogEntry() :string; From f7dd74fe658d1ca37d443dafb63fefc8715a9f18 Mon Sep 17 00:00:00 2001 From: Bradford Powell Date: Mon, 3 Feb 2025 20:46:48 -0500 Subject: [PATCH 19/21] test fixes, including FastRefreshDatabase --- composer.json | 5 +- composer.lock | 47 ++++++++++++++++++- tests/Feature/CdwgIndextTest.php | 4 +- .../CommentActivityNotificationTest.php | 4 +- .../End2End/ApplicationActivityTest.php | 4 +- tests/Feature/End2End/Auth/CheckAuthTest.php | 4 +- .../End2End/Auth/ResetPasswordTest.php | 4 +- .../Auth/SendPasswordResetLinkTest.php | 4 +- tests/Feature/End2End/CoiReminderTest.php | 4 +- .../End2End/Comments/CommentCreateTest.php | 4 +- .../End2End/Comments/CommentDeleteTest.php | 2 +- .../End2End/Comments/CommentListTest.php | 2 +- .../Feature/End2End/Comments/CommentTest.php | 4 +- .../End2End/Comments/CommentUpdateTest.php | 4 +- .../End2End/Comments/ResolveCommentTest.php | 4 +- .../End2End/Comments/UnresolveCommentTest.php | 4 +- .../Feature/End2End/CreateInstitutionTest.php | 4 +- .../DataExchange/ConsumeCspecMessagesTest.php | 4 +- .../ExpertPanels/ApplicationApprovalTest.php | 4 +- .../ExpertPanels/CompleteApplicationTest.php | 4 +- .../ExpertPanels/Contacts/AddContactsTest.php | 4 +- .../Contacts/RemoveContactTest.php | 4 +- .../ExpertPanels/DeleteApplicationTest.php | 4 +- .../Documents/DeleteDocumentTest.php | 4 +- .../ExpertPanels/Documents/DownloadTest.php | 4 +- .../ExpertPanels/Documents/MarkFinalTest.php | 4 +- .../Documents/UpdateDocumentInfoTest.php | 4 +- .../ExpertPanels/Documents/UploadTest.php | 4 +- .../ExpertPanels/ExpertPanelDetailTest.php | 4 +- .../End2End/ExpertPanels/IndexTest.php | 4 +- .../End2End/ExpertPanels/InitiationTest.php | 4 +- .../LogEntries/AddLogEntryTest.php | 4 +- .../LogEntries/DeleteLogEntryTest.php | 4 +- .../LogEntries/UpdateLogEntryTest.php | 4 +- .../NextActions/AddNextActionTest.php | 4 +- .../NextActions/CompleteNextActionTest.php | 4 +- .../NextActions/DeleteNextActionTest.php | 4 +- .../NextActions/UpdateNextActionTest.php | 4 +- .../ExpertPanels/SimpleCoiEndpointTest.php | 4 +- .../ExpertPanels/UpdateApprovalDateTest.php | 4 +- .../UpdateExpertPanelAttributesTest.php | 4 +- tests/Feature/End2End/FollowActionsTest.php | 4 +- .../End2End/Group/CoiResponseStoreTest.php | 4 +- .../SubmissionApprovalRemindersCreateTest.php | 4 +- .../End2End/Groups/AddActivityLogTest.php | 4 +- ...SystemPermissionToNewMemberOfGroupTest.php | 4 +- .../Groups/ApplicationSendToChairsTest.php | 4 +- .../End2End/Groups/AttestationGcepTest.php | 4 +- .../End2End/Groups/AttestationNhgriTest.php | 4 +- .../Groups/AttestationReanalysisTest.php | 4 +- .../CompleteSustainedCurationReviewTest.php | 4 +- .../End2End/Groups/CreateAnnualUpdateTest.php | 4 +- .../Groups/CreateAnnualUpdatesForAllTest.php | 4 +- .../End2End/Groups/CreateGroupTest.php | 4 +- .../End2End/Groups/DeleteActivityLogTest.php | 4 +- .../End2End/Groups/DeleteGroupTest.php | 4 +- .../Groups/Documents/AddDocumentTest.php | 4 +- .../Groups/Documents/UpdateDocumentTest.php | 4 +- .../EvidenceSummaries/CreateSummaryTest.php | 4 +- .../EvidenceSummaries/DeleteSummaryTest.php | 4 +- .../EvidenceSummaries/GetSummariesTest.php | 4 +- .../EvidenceSummaries/UpdateSummaryTest.php | 4 +- .../Groups/Genes/AddGenesToVcepTest.php | 4 +- .../Groups/Genes/GetGenesForGroupTest.php | 4 +- .../Genes/MailSentOnGeneListChangeTest.php | 4 +- .../Genes/RemoveGeneFromExpertPanelTest.php | 4 +- .../End2End/Groups/Genes/UpdateGeneTest.php | 4 +- .../End2End/Groups/GetSpecificationsTest.php | 4 +- tests/Feature/End2End/Groups/GetTasksTest.php | 4 +- .../End2End/Groups/GroupCommandTest.php | 4 +- .../End2End/Groups/JudgementDeleteTest.php | 2 +- .../Feature/End2End/Groups/JudgementTest.php | 4 +- .../End2End/Groups/JudgementUpdateTest.php | 4 +- .../End2End/Groups/ListActivityLogsTest.php | 4 +- .../End2End/Groups/MemberUnretireTest.php | 4 +- .../Groups/Members/AddGroupMemberTest.php | 4 +- .../Groups/Members/AssignRoleToMemberTest.php | 13 +++-- .../Members/GrantMemberPermissionTest.php | 4 +- .../Groups/Members/InviteMemberTest.php | 4 +- .../Groups/Members/RemoveMemberTest.php | 4 +- .../Members/RemoveRoleFromMemberTest.php | 4 +- .../Groups/Members/RetireMemberTest.php | 4 +- .../Members/RevokeMemberPermissionTest.php | 4 +- .../Groups/Members/UpdateMemberTest.php | 4 +- .../Groups/PublishApplicationEventsTest.php | 8 ++-- ...ionFromRemovedOrRetiredGroupMemberTest.php | 4 +- .../End2End/Groups/SaveAnnualUpdateTest.php | 4 +- .../Submissions/RejectSubmissionTest.php | 4 +- .../Submissions/SubmitApplicationStepTest.php | 4 +- .../End2End/Groups/SubmitAnnualUpdateTest.php | 4 +- .../End2End/Groups/UpdateActivityLogTest.php | 4 +- .../Groups/UpdateAffiliationIdTest.php | 4 +- .../Groups/UpdateCurationProcessTest.php | 4 +- .../End2End/Groups/UpdateEpNameTest.php | 4 +- .../End2End/Groups/UpdateGroupNameTest.php | 4 +- .../End2End/Groups/UpdateGroupParentTest.php | 4 +- .../End2End/Groups/UpdateGroupStatusTest.php | 4 +- .../UpdateMembershipDescriptionTest.php | 4 +- .../Groups/UpdateScopeDescriptionTest.php | 4 +- tests/Feature/End2End/InviteReminderTest.php | 4 +- .../Mail/RenderUserDefinedTemplateTest.php | 4 +- .../End2End/MarkNotificationReadTest.php | 4 +- .../Credentials/CreateCredentialsTest.php | 4 +- .../Credentials/DeleteCredentialTest.php | 4 +- .../Credentials/MergeCredentialsTest.php | 4 +- .../Credentials/SearchCredentialsTest.php | 4 +- .../Credentials/UpdateCredentialTest.php | 4 +- .../Expertises/CreateExpertisesTest.php | 4 +- .../Person/Expertises/DeleteExpertiseTest.php | 4 +- .../Person/Expertises/MergeExpertisesTest.php | 4 +- .../Expertises/SearchExpertisesTest.php | 4 +- .../Person/Expertises/UpdateExpertiseTest.php | 4 +- .../End2End/Person/GetNotificationsTest.php | 4 +- .../End2End/Person/InstitutionDeleteTest.php | 4 +- .../Person/InstitutionMarkApprovedTest.php | 4 +- .../End2End/Person/InstitutionUpdateTest.php | 4 +- .../Feature/End2End/Person/ListPeopleTest.php | 4 +- .../End2End/Person/MergeInstitutionsTest.php | 4 +- .../End2End/Person/PersonDeleteTest.php | 4 +- .../End2End/Person/PersonDetailTest.php | 4 +- .../End2End/Person/PersonMergeTest.php | 4 +- .../End2End/Person/PersonPhotoStoreTest.php | 4 +- .../End2End/Person/RedeemInviteTest.php | 4 +- .../End2End/Person/ResetInviteTest.php | 4 +- .../End2End/Person/UpdateProfileTest.php | 4 +- tests/Feature/End2End/PersonEndpointTest.php | 4 +- tests/Feature/End2End/ResendMailTest.php | 4 +- .../SendSubmissionDigestNotificationsTest.php | 4 +- tests/Feature/End2End/SyncGenesToGcepTest.php | 4 +- tests/Feature/End2End/Tasks/TaskIndexTest.php | 4 +- .../End2End/Users/ArtisanCreateUserTest.php | 4 +- .../UpdateUserRolesAndPermissionsTest.php | 4 +- .../Controllers/ScheduleControllerTest.php | 20 ++++++++ .../ClassifiedRulesApprovedProcessorTest.php | 4 +- .../DX/Actions/CspecDataSyncProcessorTest.php | 4 +- .../Integration/DX/Actions/DxConsumeTest.php | 4 +- .../DX/Actions/IncomingMessageStoreTest.php | 4 +- .../PilotRulesApprovedProcessorTest.php | 4 +- .../Integration/ImpersonateSearchTest.php | 4 +- .../Actions/ApplicationCompleteTest.php | 4 +- .../Actions/ApplicationDocumentAddTest.php | 4 +- .../Actions/CompleteNextActionTest.php | 4 +- .../Application/Actions/ContactAddTest.php | 4 +- .../Application/Actions/ContactRemoveTest.php | 4 +- .../Actions/NextActionCreateTest.php | 4 +- .../Application/Actions/StepApproveTest.php | 4 +- .../Application/Models/ExpertPanelTest.php | 4 +- .../Actions/ExpertPanelCreateTest.php | 4 +- .../ExpertPanelUpdateAttributesTest.php | 4 +- .../Group/Actions/JudgementCreateTest.php | 4 +- .../Person/Actions/PersonCreateTest.php | 4 +- .../Modules/Person/Models/CredentialTest.php | 4 +- .../Modules/Person/Models/InviteTest.php | 4 +- .../Modules/User/Actions/CreateUserTest.php | 4 +- .../Modules/User/Actions/UpdateUserTest.php | 4 +- .../Notificaitons/NotifyStepApprovedTest.php | 4 +- .../Integration/RecordsOutgoingMailTest.php | 4 +- .../UseDatabaseTransactionsTest.php | 4 +- tests/Feature/IsGroupMemberTest.php | 4 +- tests/Feature/MailContactsTest.php | 4 +- tests/Feature/MessagePusherFactoryTest.php | 2 +- .../Person/Actions/PermissionAddTest.php | 4 +- .../Person/Actions/PermissionRemoveTest.php | 4 +- tests/Feature/PersonLookupsEndpointTest.php | 4 +- tests/TestCase.php | 4 +- .../DataFixes/ReorderStreamMessagesTest.php | 4 +- tests/Unit/CoiApplyingActiveTest.php | 4 +- .../MessageFactories/DxMessageFactoryTest.php | 4 +- tests/Unit/FollowActionTest.php | 4 +- tests/Unit/Listeners/RecordEventTest.php | 4 +- .../Service/StepManagerFactoryTest.php | 4 +- .../AddedToGroupNotificationTest.php | 4 +- tests/Unit/PersonTest.php | 4 +- 173 files changed, 414 insertions(+), 343 deletions(-) create mode 100644 tests/Feature/Http/Controllers/ScheduleControllerTest.php diff --git a/composer.json b/composer.json index 75d909184..6e843c156 100644 --- a/composer.json +++ b/composer.json @@ -27,13 +27,14 @@ }, "require-dev": { "brianium/paratest": "^6.4", - "spatie/laravel-ignition": "^2.0", "fakerphp/faker": "^1.9.1", "laravel/sail": "^1.0.1", "mockery/mockery": "^1.4.2", "nunomaduro/collision": "^6.1", "phpmd/phpmd": "^2.13", - "phpunit/phpunit": "^9.3.3" + "phpunit/phpunit": "^9.3.3", + "plannr/laravel-fast-refresh-database": "^1.2", + "spatie/laravel-ignition": "^2.0" }, "config": { "optimize-autoloader": true, diff --git a/composer.lock b/composer.lock index 594844e77..59c197b92 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "de1e562128f629d2883ddb71949c41d0", + "content-hash": "62f9ea8ab78b697b92a491c00cfd7aeb", "packages": [ { "name": "bacon/bacon-qr-code", @@ -8961,6 +8961,51 @@ ], "time": "2023-12-01T16:55:19+00:00" }, + { + "name": "plannr/laravel-fast-refresh-database", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/PlannrCrm/laravel-fast-refresh-database.git", + "reference": "b462772b0c87d683dd3f67706e174082ebea180c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PlannrCrm/laravel-fast-refresh-database/zipball/b462772b0c87d683dd3f67706e174082ebea180c", + "reference": "b462772b0c87d683dd3f67706e174082ebea180c", + "shasum": "" + }, + "require": { + "php": "^8.1", + "symfony/process": "^6.0 || ^7.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.13", + "orchestra/testbench": "^9.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Plannr\\Laravel\\FastRefreshDatabase\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Sam Carré", + "email": "29132017+Sammyjo20@users.noreply.github.com" + } + ], + "description": "Refresh your database faster than you've ever seen before 🚀", + "support": { + "issues": "https://github.com/PlannrCrm/laravel-fast-refresh-database/issues", + "source": "https://github.com/PlannrCrm/laravel-fast-refresh-database/tree/v1.2.0" + }, + "time": "2024-04-08T11:29:20+00:00" + }, { "name": "sebastian/cli-parser", "version": "1.0.1", diff --git a/tests/Feature/CdwgIndextTest.php b/tests/Feature/CdwgIndextTest.php index b033def3a..7939c8f9d 100644 --- a/tests/Feature/CdwgIndextTest.php +++ b/tests/Feature/CdwgIndextTest.php @@ -7,11 +7,11 @@ use App\Modules\User\Models\User; use App\Modules\Group\Models\Group; use Database\Seeders\GroupTypeSeeder; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class CdwgIndextTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/CommentActivityNotificationTest.php b/tests/Feature/CommentActivityNotificationTest.php index 676b8fadc..79502c5c6 100644 --- a/tests/Feature/CommentActivityNotificationTest.php +++ b/tests/Feature/CommentActivityNotificationTest.php @@ -9,11 +9,11 @@ use App\Modules\Person\Models\Person; use Illuminate\Foundation\Testing\WithFaker; use Illuminate\Support\Facades\Notification; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class CommentActivityNotificationTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/ApplicationActivityTest.php b/tests/Feature/End2End/ApplicationActivityTest.php index 490563a8b..16283bb71 100644 --- a/tests/Feature/End2End/ApplicationActivityTest.php +++ b/tests/Feature/End2End/ApplicationActivityTest.php @@ -10,14 +10,14 @@ use App\Modules\ExpertPanel\Models\ExpertPanel; use App\Modules\ExpertPanel\Actions\StepApprove; use Database\Seeders\NextActionTypesTableSeeder; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Database\Seeders\SubmissionTypeAndStatusSeeder; use App\Modules\Group\Actions\ApplicationSubmitStep; use Database\Seeders\NextActionAssigneesTableSeeder; class ApplicationActivityTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; private $user; private $submit; diff --git a/tests/Feature/End2End/Auth/CheckAuthTest.php b/tests/Feature/End2End/Auth/CheckAuthTest.php index 109be6bc4..82d6422e3 100644 --- a/tests/Feature/End2End/Auth/CheckAuthTest.php +++ b/tests/Feature/End2End/Auth/CheckAuthTest.php @@ -5,11 +5,11 @@ use Tests\TestCase; use App\Modules\User\Models\User; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class CheckAuthTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Auth/ResetPasswordTest.php b/tests/Feature/End2End/Auth/ResetPasswordTest.php index 1ce2af44f..26895cf39 100644 --- a/tests/Feature/End2End/Auth/ResetPasswordTest.php +++ b/tests/Feature/End2End/Auth/ResetPasswordTest.php @@ -3,14 +3,14 @@ namespace Tests\Feature\End2End\Auth; use App\Modules\User\Models\User; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Illuminate\Foundation\Testing\WithFaker; use Illuminate\Support\Facades\DB; use Tests\TestCase; class ResetPasswordTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Auth/SendPasswordResetLinkTest.php b/tests/Feature/End2End/Auth/SendPasswordResetLinkTest.php index 4fa600b82..b338393c7 100644 --- a/tests/Feature/End2End/Auth/SendPasswordResetLinkTest.php +++ b/tests/Feature/End2End/Auth/SendPasswordResetLinkTest.php @@ -7,11 +7,11 @@ use Illuminate\Auth\Notifications\ResetPassword; use Illuminate\Foundation\Testing\WithFaker; use Illuminate\Support\Facades\Notification; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class SendPasswordResetLinkTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/CoiReminderTest.php b/tests/Feature/End2End/CoiReminderTest.php index 125f1c71c..9767e1e3f 100644 --- a/tests/Feature/End2End/CoiReminderTest.php +++ b/tests/Feature/End2End/CoiReminderTest.php @@ -12,14 +12,14 @@ use App\Modules\Group\Actions\MemberRetire; use Illuminate\Support\Facades\Notification; use App\Notifications\CoiReminderNotification; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class CoiReminderTest extends TestCase { private $group; private $user1; private $membership1; - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Comments/CommentCreateTest.php b/tests/Feature/End2End/Comments/CommentCreateTest.php index d6a8eb770..c0ea47d1d 100644 --- a/tests/Feature/End2End/Comments/CommentCreateTest.php +++ b/tests/Feature/End2End/Comments/CommentCreateTest.php @@ -12,13 +12,13 @@ use Illuminate\Foundation\Testing\WithFaker; use Illuminate\Support\Facades\Notification; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Database\Seeders\SubmissionTypeAndStatusSeeder; use App\Modules\Group\Notifications\CommentActivityNotification; class CommentCreateTest extends CommentTest { - use RefreshDatabase; + use FastRefreshDatabase; protected $expertPanel, $user; diff --git a/tests/Feature/End2End/Comments/CommentDeleteTest.php b/tests/Feature/End2End/Comments/CommentDeleteTest.php index 361418675..f1ad4fa0c 100644 --- a/tests/Feature/End2End/Comments/CommentDeleteTest.php +++ b/tests/Feature/End2End/Comments/CommentDeleteTest.php @@ -9,7 +9,7 @@ use App\Modules\Group\Models\Submission; use Illuminate\Foundation\Testing\WithFaker; use Illuminate\Support\Facades\Notification; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\Modules\Group\Notifications\CommentActivityNotification; use Tests\Feature\End2End\Comments\TestsCommentActivityNotificationSent; diff --git a/tests/Feature/End2End/Comments/CommentListTest.php b/tests/Feature/End2End/Comments/CommentListTest.php index 0fcdf5874..7c5c34994 100644 --- a/tests/Feature/End2End/Comments/CommentListTest.php +++ b/tests/Feature/End2End/Comments/CommentListTest.php @@ -6,7 +6,7 @@ use App\Models\Comment; use App\Modules\Group\Models\Group; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class CommentListTest extends CommentTest { diff --git a/tests/Feature/End2End/Comments/CommentTest.php b/tests/Feature/End2End/Comments/CommentTest.php index 185ba8633..00055610b 100644 --- a/tests/Feature/End2End/Comments/CommentTest.php +++ b/tests/Feature/End2End/Comments/CommentTest.php @@ -9,12 +9,12 @@ use Database\Seeders\CommentTypesSeeder; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Database\Seeders\SubmissionTypeAndStatusSeeder; abstract class CommentTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; protected $user, $expertPanel; diff --git a/tests/Feature/End2End/Comments/CommentUpdateTest.php b/tests/Feature/End2End/Comments/CommentUpdateTest.php index 60270a2a3..b7c44ba45 100644 --- a/tests/Feature/End2End/Comments/CommentUpdateTest.php +++ b/tests/Feature/End2End/Comments/CommentUpdateTest.php @@ -9,12 +9,12 @@ use Illuminate\Foundation\Testing\WithFaker; use Illuminate\Support\Facades\Notification; use Tests\Feature\End2End\Comments\CommentTest; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\Modules\Group\Notifications\CommentActivityNotification; class CommentUpdateTest extends CommentTest { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Comments/ResolveCommentTest.php b/tests/Feature/End2End/Comments/ResolveCommentTest.php index 803ac7135..2557ea546 100644 --- a/tests/Feature/End2End/Comments/ResolveCommentTest.php +++ b/tests/Feature/End2End/Comments/ResolveCommentTest.php @@ -14,11 +14,11 @@ use App\Modules\Group\Notifications\CommentActivityNotification; use Illuminate\Foundation\Testing\WithFaker; use Illuminate\Support\Facades\Notification; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class ResolveCommentTest extends CommentTest { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Comments/UnresolveCommentTest.php b/tests/Feature/End2End/Comments/UnresolveCommentTest.php index 0e954ed56..546b8b139 100644 --- a/tests/Feature/End2End/Comments/UnresolveCommentTest.php +++ b/tests/Feature/End2End/Comments/UnresolveCommentTest.php @@ -8,11 +8,11 @@ use App\Actions\CommentResolve; use Illuminate\Testing\TestResponse; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class UnresolveCommentTest extends CommentTest { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/CreateInstitutionTest.php b/tests/Feature/End2End/CreateInstitutionTest.php index 6a93afa3a..a6a9b109a 100644 --- a/tests/Feature/End2End/CreateInstitutionTest.php +++ b/tests/Feature/End2End/CreateInstitutionTest.php @@ -7,11 +7,11 @@ use App\Modules\Person\Models\Country; use App\Modules\Person\Models\Institution; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class CreateInstitutionTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/DataExchange/ConsumeCspecMessagesTest.php b/tests/Feature/End2End/DataExchange/ConsumeCspecMessagesTest.php index 85bc04f0f..bc92d618e 100644 --- a/tests/Feature/End2End/DataExchange/ConsumeCspecMessagesTest.php +++ b/tests/Feature/End2End/DataExchange/ConsumeCspecMessagesTest.php @@ -13,14 +13,14 @@ use App\DataExchange\Contracts\MessageStream; use App\Modules\ExpertPanel\Models\ExpertPanel; use Database\Seeders\SpecificationStatusSeeder; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; /** * @group dx */ class ConsumeCspecMessagesTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; private $vcep; private $consumer; diff --git a/tests/Feature/End2End/ExpertPanels/ApplicationApprovalTest.php b/tests/Feature/End2End/ExpertPanels/ApplicationApprovalTest.php index 2e0aae698..f50bf8e63 100644 --- a/tests/Feature/End2End/ExpertPanels/ApplicationApprovalTest.php +++ b/tests/Feature/End2End/ExpertPanels/ApplicationApprovalTest.php @@ -21,14 +21,14 @@ use App\Modules\ExpertPanel\Events\StepApproved; use App\Modules\ExpertPanel\Models\ExpertPanel; use Database\Seeders\NextActionTypesTableSeeder; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Database\Seeders\SubmissionTypeAndStatusSeeder; use Database\Seeders\NextActionAssigneesTableSeeder; use App\Modules\ExpertPanel\Notifications\ApplicationStepApprovedNotification; class ApplicationApprovalTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; private $person, $expertPanel, $user; diff --git a/tests/Feature/End2End/ExpertPanels/CompleteApplicationTest.php b/tests/Feature/End2End/ExpertPanels/CompleteApplicationTest.php index 6bb3dd880..8cb83ad05 100644 --- a/tests/Feature/End2End/ExpertPanels/CompleteApplicationTest.php +++ b/tests/Feature/End2End/ExpertPanels/CompleteApplicationTest.php @@ -9,11 +9,11 @@ use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Actions\StepApprove; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class CompleteApplicationTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; private $user, $expertPanel; diff --git a/tests/Feature/End2End/ExpertPanels/Contacts/AddContactsTest.php b/tests/Feature/End2End/ExpertPanels/Contacts/AddContactsTest.php index f2a7ab83f..e0b3d192e 100644 --- a/tests/Feature/End2End/ExpertPanels/Contacts/AddContactsTest.php +++ b/tests/Feature/End2End/ExpertPanels/Contacts/AddContactsTest.php @@ -12,7 +12,7 @@ use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Actions\ContactAdd; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; /** * @group applications @@ -22,7 +22,7 @@ */ class AddContactsTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/ExpertPanels/Contacts/RemoveContactTest.php b/tests/Feature/End2End/ExpertPanels/Contacts/RemoveContactTest.php index 368bdfb0b..1e544e529 100644 --- a/tests/Feature/End2End/ExpertPanels/Contacts/RemoveContactTest.php +++ b/tests/Feature/End2End/ExpertPanels/Contacts/RemoveContactTest.php @@ -11,7 +11,7 @@ use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Actions\ContactAdd; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; /** * @group applications @@ -21,7 +21,7 @@ */ class RemoveContactTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/ExpertPanels/DeleteApplicationTest.php b/tests/Feature/End2End/ExpertPanels/DeleteApplicationTest.php index 779e48b96..5ceb81729 100644 --- a/tests/Feature/End2End/ExpertPanels/DeleteApplicationTest.php +++ b/tests/Feature/End2End/ExpertPanels/DeleteApplicationTest.php @@ -6,12 +6,12 @@ use App\Modules\User\Models\User; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Laravel\Sanctum\Sanctum; class DeleteApplicationTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/ExpertPanels/Documents/DeleteDocumentTest.php b/tests/Feature/End2End/ExpertPanels/Documents/DeleteDocumentTest.php index b5439b89e..ecc862ee9 100644 --- a/tests/Feature/End2End/ExpertPanels/Documents/DeleteDocumentTest.php +++ b/tests/Feature/End2End/ExpertPanels/Documents/DeleteDocumentTest.php @@ -10,14 +10,14 @@ use App\Modules\User\Models\User; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; /** * @group documents */ class DeleteDocumentTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/ExpertPanels/Documents/DownloadTest.php b/tests/Feature/End2End/ExpertPanels/Documents/DownloadTest.php index e5ca2aad2..89981e86b 100644 --- a/tests/Feature/End2End/ExpertPanels/Documents/DownloadTest.php +++ b/tests/Feature/End2End/ExpertPanels/Documents/DownloadTest.php @@ -14,7 +14,7 @@ use Tests\CreatesDocumentUploadRequestData; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\Modules\ExpertPanel\Actions\ApplicationDocumentAdd; /** @@ -22,7 +22,7 @@ */ class DownloadTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; use CreatesDocumentUploadRequestData; public function setup():void diff --git a/tests/Feature/End2End/ExpertPanels/Documents/MarkFinalTest.php b/tests/Feature/End2End/ExpertPanels/Documents/MarkFinalTest.php index c3136b6ec..a56529e01 100644 --- a/tests/Feature/End2End/ExpertPanels/Documents/MarkFinalTest.php +++ b/tests/Feature/End2End/ExpertPanels/Documents/MarkFinalTest.php @@ -9,7 +9,7 @@ use App\Modules\User\Models\User; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Illuminate\Support\Facades\Bus; /** @@ -17,7 +17,7 @@ */ class MarkFinalTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/ExpertPanels/Documents/UpdateDocumentInfoTest.php b/tests/Feature/End2End/ExpertPanels/Documents/UpdateDocumentInfoTest.php index 5ba2e7095..740d9b2ca 100644 --- a/tests/Feature/End2End/ExpertPanels/Documents/UpdateDocumentInfoTest.php +++ b/tests/Feature/End2End/ExpertPanels/Documents/UpdateDocumentInfoTest.php @@ -8,7 +8,7 @@ use App\Modules\User\Models\User; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Laravel\Sanctum\Sanctum; /** @@ -16,7 +16,7 @@ */ class UpdateDocumentInfoTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/ExpertPanels/Documents/UploadTest.php b/tests/Feature/End2End/ExpertPanels/Documents/UploadTest.php index 0517db360..bc1606a1c 100644 --- a/tests/Feature/End2End/ExpertPanels/Documents/UploadTest.php +++ b/tests/Feature/End2End/ExpertPanels/Documents/UploadTest.php @@ -13,14 +13,14 @@ use Tests\CreatesDocumentUploadRequestData; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; /** * @group documents */ class UploadTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; use CreatesDocumentUploadRequestData; public function setup():void diff --git a/tests/Feature/End2End/ExpertPanels/ExpertPanelDetailTest.php b/tests/Feature/End2End/ExpertPanels/ExpertPanelDetailTest.php index 46841be68..867f8f888 100644 --- a/tests/Feature/End2End/ExpertPanels/ExpertPanelDetailTest.php +++ b/tests/Feature/End2End/ExpertPanels/ExpertPanelDetailTest.php @@ -12,7 +12,7 @@ use App\Modules\ExpertPanel\Actions\ContactAdd; use App\Modules\ExpertPanel\Models\ExpertPanel; use App\Modules\ExpertPanel\Actions\LogEntryAdd; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\Modules\ExpertPanel\Actions\NextActionCreate; use App\Modules\ExpertPanel\Actions\ExpertPanelCreate; use App\Modules\ExpertPanel\Actions\ApplicationDocumentAdd; @@ -20,7 +20,7 @@ class ExpertPanelDetailTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/ExpertPanels/IndexTest.php b/tests/Feature/End2End/ExpertPanels/IndexTest.php index c791a1d7e..2e04f7637 100644 --- a/tests/Feature/End2End/ExpertPanels/IndexTest.php +++ b/tests/Feature/End2End/ExpertPanels/IndexTest.php @@ -11,11 +11,11 @@ use Illuminate\Database\Eloquent\Collection; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class IndexTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; use WithFaker; const URL = '/api/applications'; diff --git a/tests/Feature/End2End/ExpertPanels/InitiationTest.php b/tests/Feature/End2End/ExpertPanels/InitiationTest.php index bdebff6da..d7219e620 100644 --- a/tests/Feature/End2End/ExpertPanels/InitiationTest.php +++ b/tests/Feature/End2End/ExpertPanels/InitiationTest.php @@ -6,12 +6,12 @@ use Laravel\Sanctum\Sanctum; use App\Modules\User\Models\User; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class InitiationTest extends TestCase { use WithFaker; - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/ExpertPanels/LogEntries/AddLogEntryTest.php b/tests/Feature/End2End/ExpertPanels/LogEntries/AddLogEntryTest.php index a4da62889..577f2176d 100644 --- a/tests/Feature/End2End/ExpertPanels/LogEntries/AddLogEntryTest.php +++ b/tests/Feature/End2End/ExpertPanels/LogEntries/AddLogEntryTest.php @@ -8,11 +8,11 @@ use App\Modules\Group\Models\Group; use App\Modules\User\Models\User; use Illuminate\Support\Carbon; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class AddLogEntryTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/ExpertPanels/LogEntries/DeleteLogEntryTest.php b/tests/Feature/End2End/ExpertPanels/LogEntries/DeleteLogEntryTest.php index a9c3474df..02878c4e7 100644 --- a/tests/Feature/End2End/ExpertPanels/LogEntries/DeleteLogEntryTest.php +++ b/tests/Feature/End2End/ExpertPanels/LogEntries/DeleteLogEntryTest.php @@ -9,7 +9,7 @@ use App\Modules\ExpertPanel\Actions\StepApprove; use App\Modules\ExpertPanel\Models\ExpertPanel; use App\Modules\ExpertPanel\Actions\LogEntryAdd; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; /** * @group applications @@ -17,7 +17,7 @@ */ class DeleteLogEntryTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/ExpertPanels/LogEntries/UpdateLogEntryTest.php b/tests/Feature/End2End/ExpertPanels/LogEntries/UpdateLogEntryTest.php index cbafbdf2a..e275e118f 100644 --- a/tests/Feature/End2End/ExpertPanels/LogEntries/UpdateLogEntryTest.php +++ b/tests/Feature/End2End/ExpertPanels/LogEntries/UpdateLogEntryTest.php @@ -9,11 +9,11 @@ use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; use App\Modules\ExpertPanel\Actions\LogEntryAdd; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class UpdateLogEntryTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/ExpertPanels/NextActions/AddNextActionTest.php b/tests/Feature/End2End/ExpertPanels/NextActions/AddNextActionTest.php index 77d9dab1a..cb08338b3 100644 --- a/tests/Feature/End2End/ExpertPanels/NextActions/AddNextActionTest.php +++ b/tests/Feature/End2End/ExpertPanels/NextActions/AddNextActionTest.php @@ -11,7 +11,7 @@ use App\Modules\ExpertPanel\Models\NextAction; use App\Modules\ExpertPanel\Models\ExpertPanel; use Database\Factories\NextActionAssigneeFactory; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Database\Seeders\NextActionAssigneesTableSeeder; use App\Modules\ExpertPanel\Models\NextActionAssignee; @@ -22,7 +22,7 @@ */ class AddNextActionTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/ExpertPanels/NextActions/CompleteNextActionTest.php b/tests/Feature/End2End/ExpertPanels/NextActions/CompleteNextActionTest.php index 61268c51e..f1f3e9cb2 100644 --- a/tests/Feature/End2End/ExpertPanels/NextActions/CompleteNextActionTest.php +++ b/tests/Feature/End2End/ExpertPanels/NextActions/CompleteNextActionTest.php @@ -7,7 +7,7 @@ use Illuminate\Support\Carbon; use App\Modules\ExpertPanel\Models\NextAction; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Database\Seeders\NextActionAssigneesTableSeeder; use App\Modules\ExpertPanel\Actions\NextActionCreate; @@ -18,7 +18,7 @@ */ class CompleteNextActionTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/ExpertPanels/NextActions/DeleteNextActionTest.php b/tests/Feature/End2End/ExpertPanels/NextActions/DeleteNextActionTest.php index 045bb1a68..bbbcc0d37 100644 --- a/tests/Feature/End2End/ExpertPanels/NextActions/DeleteNextActionTest.php +++ b/tests/Feature/End2End/ExpertPanels/NextActions/DeleteNextActionTest.php @@ -9,7 +9,7 @@ use Illuminate\Support\Facades\Bus; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Database\Seeders\NextActionAssigneesTableSeeder; use App\Modules\ExpertPanel\Actions\NextActionCreate; @@ -20,7 +20,7 @@ */ class DeleteNextActionTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/ExpertPanels/NextActions/UpdateNextActionTest.php b/tests/Feature/End2End/ExpertPanels/NextActions/UpdateNextActionTest.php index b1085537f..b2fad8cf4 100644 --- a/tests/Feature/End2End/ExpertPanels/NextActions/UpdateNextActionTest.php +++ b/tests/Feature/End2End/ExpertPanels/NextActions/UpdateNextActionTest.php @@ -9,7 +9,7 @@ use Illuminate\Support\Facades\Bus; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Database\Seeders\NextActionAssigneesTableSeeder; use App\Modules\ExpertPanel\Actions\NextActionCreate; @@ -20,7 +20,7 @@ */ class UpdateNextActionTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/ExpertPanels/SimpleCoiEndpointTest.php b/tests/Feature/End2End/ExpertPanels/SimpleCoiEndpointTest.php index 8db14e723..f0db64a29 100644 --- a/tests/Feature/End2End/ExpertPanels/SimpleCoiEndpointTest.php +++ b/tests/Feature/End2End/ExpertPanels/SimpleCoiEndpointTest.php @@ -16,14 +16,14 @@ use App\Modules\Group\Models\GroupMember; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; /** * @group coi */ class SimpleCoiEndpointTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; private $group; private $groupMember; diff --git a/tests/Feature/End2End/ExpertPanels/UpdateApprovalDateTest.php b/tests/Feature/End2End/ExpertPanels/UpdateApprovalDateTest.php index 4e6e0d013..23bb2214b 100644 --- a/tests/Feature/End2End/ExpertPanels/UpdateApprovalDateTest.php +++ b/tests/Feature/End2End/ExpertPanels/UpdateApprovalDateTest.php @@ -6,13 +6,13 @@ use App\Modules\User\Models\User; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Illuminate\Support\Carbon; use Laravel\Sanctum\Sanctum; class UpdateApprovalDateTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; private $user, $expertPanel; diff --git a/tests/Feature/End2End/ExpertPanels/UpdateExpertPanelAttributesTest.php b/tests/Feature/End2End/ExpertPanels/UpdateExpertPanelAttributesTest.php index bcf84fc96..22f1d5d5a 100644 --- a/tests/Feature/End2End/ExpertPanels/UpdateExpertPanelAttributesTest.php +++ b/tests/Feature/End2End/ExpertPanels/UpdateExpertPanelAttributesTest.php @@ -10,11 +10,11 @@ use App\Modules\Group\Models\Group; use Illuminate\Testing\TestResponse; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class UpdateExpertPanelAttributesTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; private $user, $cdwg, $longText; diff --git a/tests/Feature/End2End/FollowActionsTest.php b/tests/Feature/End2End/FollowActionsTest.php index c138c936a..cab970818 100644 --- a/tests/Feature/End2End/FollowActionsTest.php +++ b/tests/Feature/End2End/FollowActionsTest.php @@ -11,11 +11,11 @@ use App\Modules\Group\Events\GroupNameUpdated; use App\Modules\Group\Actions\GroupStatusUpdate; use App\Modules\Group\Events\GroupStatusUpdated; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class FollowActionsTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Group/CoiResponseStoreTest.php b/tests/Feature/End2End/Group/CoiResponseStoreTest.php index 397dfaa5f..93f086644 100644 --- a/tests/Feature/End2End/Group/CoiResponseStoreTest.php +++ b/tests/Feature/End2End/Group/CoiResponseStoreTest.php @@ -7,11 +7,11 @@ use Illuminate\Testing\TestResponse; use App\Modules\Group\Models\GroupMember; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class CoiResponseStoreTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; use WithFaker; private $member, $user; diff --git a/tests/Feature/End2End/Group/SubmissionApprovalRemindersCreateTest.php b/tests/Feature/End2End/Group/SubmissionApprovalRemindersCreateTest.php index ead875f65..3becdc682 100644 --- a/tests/Feature/End2End/Group/SubmissionApprovalRemindersCreateTest.php +++ b/tests/Feature/End2End/Group/SubmissionApprovalRemindersCreateTest.php @@ -12,7 +12,7 @@ use App\Modules\Group\Actions\JudgementCreate; use App\Modules\ExpertPanel\Models\ExpertPanel; use Database\Seeders\NextActionTypesTableSeeder; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Database\Seeders\SubmissionTypeAndStatusSeeder; use App\Modules\Group\Actions\ApplicationSubmitStep; use Database\Seeders\NextActionAssigneesTableSeeder; @@ -23,7 +23,7 @@ class SubmissionApprovalRemindersCreateTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Groups/AddActivityLogTest.php b/tests/Feature/End2End/Groups/AddActivityLogTest.php index fa392d298..8323e3dd1 100644 --- a/tests/Feature/End2End/Groups/AddActivityLogTest.php +++ b/tests/Feature/End2End/Groups/AddActivityLogTest.php @@ -5,7 +5,7 @@ use App\Models\Activity; use App\Modules\Group\Models\Group; use App\Modules\User\Models\User; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Illuminate\Foundation\Testing\WithFaker; use Laravel\Sanctum\Sanctum; use Tests\TestCase; @@ -16,7 +16,7 @@ */ class AddActivityLogTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Groups/AddSystemPermissionToNewMemberOfGroupTest.php b/tests/Feature/End2End/Groups/AddSystemPermissionToNewMemberOfGroupTest.php index 258c9b9f8..9fbe408b4 100644 --- a/tests/Feature/End2End/Groups/AddSystemPermissionToNewMemberOfGroupTest.php +++ b/tests/Feature/End2End/Groups/AddSystemPermissionToNewMemberOfGroupTest.php @@ -12,12 +12,12 @@ use Illuminate\Foundation\Testing\WithFaker; use App\Modules\Person\Actions\PermissionAdd; use App\Modules\Person\Events\InviteRedeemed; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\Modules\Group\Actions\MemberAddSystemPermission; class AddSystemPermissionToNewMemberOfGroupTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Groups/ApplicationSendToChairsTest.php b/tests/Feature/End2End/Groups/ApplicationSendToChairsTest.php index 729f27b45..80f392f7a 100644 --- a/tests/Feature/End2End/Groups/ApplicationSendToChairsTest.php +++ b/tests/Feature/End2End/Groups/ApplicationSendToChairsTest.php @@ -16,7 +16,7 @@ use Illuminate\Support\Facades\Notification; use App\Modules\ExpertPanel\Models\ExpertPanel; use Database\Seeders\NextActionTypesTableSeeder; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Database\Seeders\SubmissionTypeAndStatusSeeder; use App\Modules\Group\Actions\ApplicationSubmitStep; use Database\Seeders\NextActionAssigneesTableSeeder; @@ -24,7 +24,7 @@ class ApplicationSendToChairsTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup(): void { diff --git a/tests/Feature/End2End/Groups/AttestationGcepTest.php b/tests/Feature/End2End/Groups/AttestationGcepTest.php index 618bcb62e..60c53ca25 100644 --- a/tests/Feature/End2End/Groups/AttestationGcepTest.php +++ b/tests/Feature/End2End/Groups/AttestationGcepTest.php @@ -10,13 +10,13 @@ use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; use App\Modules\Group\Events\AttestationSigned; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\Modules\Group\Actions\AttestationGcepStore; use App\Modules\Group\Models\Group; class AttestationGcepTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Groups/AttestationNhgriTest.php b/tests/Feature/End2End/Groups/AttestationNhgriTest.php index b04d1d25d..7ac34bfd3 100644 --- a/tests/Feature/End2End/Groups/AttestationNhgriTest.php +++ b/tests/Feature/End2End/Groups/AttestationNhgriTest.php @@ -7,12 +7,12 @@ use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; use Carbon\Carbon; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Laravel\Sanctum\Sanctum; class AttestationNhgriTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Groups/AttestationReanalysisTest.php b/tests/Feature/End2End/Groups/AttestationReanalysisTest.php index 1615d1231..ccf7423d4 100644 --- a/tests/Feature/End2End/Groups/AttestationReanalysisTest.php +++ b/tests/Feature/End2End/Groups/AttestationReanalysisTest.php @@ -9,11 +9,11 @@ use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; use App\Modules\Group\Actions\AttestationReanalysisStore; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class AttestationReanalysisTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Groups/CompleteSustainedCurationReviewTest.php b/tests/Feature/End2End/Groups/CompleteSustainedCurationReviewTest.php index b156c6719..c1eca33b7 100644 --- a/tests/Feature/End2End/Groups/CompleteSustainedCurationReviewTest.php +++ b/tests/Feature/End2End/Groups/CompleteSustainedCurationReviewTest.php @@ -9,11 +9,11 @@ use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; use Database\Seeders\TaskTypeSeeder; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class CompleteSustainedCurationReviewTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Groups/CreateAnnualUpdateTest.php b/tests/Feature/End2End/Groups/CreateAnnualUpdateTest.php index 0f9befb24..b497d8dc2 100644 --- a/tests/Feature/End2End/Groups/CreateAnnualUpdateTest.php +++ b/tests/Feature/End2End/Groups/CreateAnnualUpdateTest.php @@ -8,11 +8,11 @@ use App\Modules\ExpertPanel\Models\ExpertPanel; use App\Modules\Group\Actions\AnnualUpdateCreate; use Database\Seeders\AnnualUpdateWindowSeeder; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class CreateAnnualUpdateTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Groups/CreateAnnualUpdatesForAllTest.php b/tests/Feature/End2End/Groups/CreateAnnualUpdatesForAllTest.php index b20e06144..8e9f99c56 100644 --- a/tests/Feature/End2End/Groups/CreateAnnualUpdatesForAllTest.php +++ b/tests/Feature/End2End/Groups/CreateAnnualUpdatesForAllTest.php @@ -6,11 +6,11 @@ use Tests\TestCase; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class CreateAnnualUpdatesForAllTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Groups/CreateGroupTest.php b/tests/Feature/End2End/Groups/CreateGroupTest.php index e2f905c67..ce7f4d9af 100644 --- a/tests/Feature/End2End/Groups/CreateGroupTest.php +++ b/tests/Feature/End2End/Groups/CreateGroupTest.php @@ -5,12 +5,12 @@ use Tests\TestCase; use Illuminate\Support\Str; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Laravel\Sanctum\Sanctum; class CreateGroupTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Groups/DeleteActivityLogTest.php b/tests/Feature/End2End/Groups/DeleteActivityLogTest.php index 9b619f7a5..0e1ed24bf 100644 --- a/tests/Feature/End2End/Groups/DeleteActivityLogTest.php +++ b/tests/Feature/End2End/Groups/DeleteActivityLogTest.php @@ -5,7 +5,7 @@ use App\Models\Activity; use App\Modules\Group\Models\Group; use App\Modules\User\Models\User; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Illuminate\Foundation\Testing\WithFaker; use Laravel\Sanctum\Sanctum; use Tests\TestCase; @@ -16,7 +16,7 @@ */ class DeleteActivityLogTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Groups/DeleteGroupTest.php b/tests/Feature/End2End/Groups/DeleteGroupTest.php index 3893ff340..567c5b520 100644 --- a/tests/Feature/End2End/Groups/DeleteGroupTest.php +++ b/tests/Feature/End2End/Groups/DeleteGroupTest.php @@ -9,11 +9,11 @@ use App\Modules\Group\Models\GroupMember; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class DeleteGroupTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; private $user, $group; diff --git a/tests/Feature/End2End/Groups/Documents/AddDocumentTest.php b/tests/Feature/End2End/Groups/Documents/AddDocumentTest.php index 4d678f4e9..86270c351 100644 --- a/tests/Feature/End2End/Groups/Documents/AddDocumentTest.php +++ b/tests/Feature/End2End/Groups/Documents/AddDocumentTest.php @@ -9,11 +9,11 @@ use App\Modules\Group\Models\Group; use Illuminate\Support\Facades\Storage; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class AddDocumentTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Groups/Documents/UpdateDocumentTest.php b/tests/Feature/End2End/Groups/Documents/UpdateDocumentTest.php index a7897f2b1..49929fa4e 100644 --- a/tests/Feature/End2End/Groups/Documents/UpdateDocumentTest.php +++ b/tests/Feature/End2End/Groups/Documents/UpdateDocumentTest.php @@ -10,11 +10,11 @@ use App\Modules\Group\Models\Group; use Illuminate\Support\Facades\Storage; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class UpdateDocumentTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Groups/EvidenceSummaries/CreateSummaryTest.php b/tests/Feature/End2End/Groups/EvidenceSummaries/CreateSummaryTest.php index d4b2d322a..8f7663423 100644 --- a/tests/Feature/End2End/Groups/EvidenceSummaries/CreateSummaryTest.php +++ b/tests/Feature/End2End/Groups/EvidenceSummaries/CreateSummaryTest.php @@ -10,11 +10,11 @@ use Tests\Traits\SeedsHgncGenesAndDiseases; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class CreateSummaryTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; use SeedsHgncGenesAndDiseases; public function setup():void diff --git a/tests/Feature/End2End/Groups/EvidenceSummaries/DeleteSummaryTest.php b/tests/Feature/End2End/Groups/EvidenceSummaries/DeleteSummaryTest.php index 0b3f47538..d7d7fdddd 100644 --- a/tests/Feature/End2End/Groups/EvidenceSummaries/DeleteSummaryTest.php +++ b/tests/Feature/End2End/Groups/EvidenceSummaries/DeleteSummaryTest.php @@ -11,12 +11,12 @@ use Tests\Traits\SeedsHgncGenesAndDiseases; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\Modules\ExpertPanel\Models\EvidenceSummary; class DeleteSummaryTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; use SeedsHgncGenesAndDiseases; public function setup():void diff --git a/tests/Feature/End2End/Groups/EvidenceSummaries/GetSummariesTest.php b/tests/Feature/End2End/Groups/EvidenceSummaries/GetSummariesTest.php index 235ffc718..cd587d276 100644 --- a/tests/Feature/End2End/Groups/EvidenceSummaries/GetSummariesTest.php +++ b/tests/Feature/End2End/Groups/EvidenceSummaries/GetSummariesTest.php @@ -9,12 +9,12 @@ use Tests\Traits\SeedsHgncGenesAndDiseases; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\Modules\ExpertPanel\Models\EvidenceSummary; class GetSummariesTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; use SeedsHgncGenesAndDiseases; public function setup():void diff --git a/tests/Feature/End2End/Groups/EvidenceSummaries/UpdateSummaryTest.php b/tests/Feature/End2End/Groups/EvidenceSummaries/UpdateSummaryTest.php index fa6b4c9fa..532f9b111 100644 --- a/tests/Feature/End2End/Groups/EvidenceSummaries/UpdateSummaryTest.php +++ b/tests/Feature/End2End/Groups/EvidenceSummaries/UpdateSummaryTest.php @@ -11,11 +11,11 @@ use Tests\Traits\SeedsHgncGenesAndDiseases; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class UpdateSummaryTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; use SeedsHgncGenesAndDiseases; public function setup():void diff --git a/tests/Feature/End2End/Groups/Genes/AddGenesToVcepTest.php b/tests/Feature/End2End/Groups/Genes/AddGenesToVcepTest.php index 0081cb6b4..de15bcc00 100644 --- a/tests/Feature/End2End/Groups/Genes/AddGenesToVcepTest.php +++ b/tests/Feature/End2End/Groups/Genes/AddGenesToVcepTest.php @@ -16,7 +16,7 @@ use Illuminate\Support\Facades\Notification; use App\Modules\ExpertPanel\Models\ExpertPanel; use App\Modules\Group\Mail\GeneAddedToVcepMail; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; /** * @group groups @@ -26,7 +26,7 @@ */ class AddGenesToVcepTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; use SeedsHgncGenesAndDiseases; public function setup():void diff --git a/tests/Feature/End2End/Groups/Genes/GetGenesForGroupTest.php b/tests/Feature/End2End/Groups/Genes/GetGenesForGroupTest.php index 409320207..3da1e5d87 100644 --- a/tests/Feature/End2End/Groups/Genes/GetGenesForGroupTest.php +++ b/tests/Feature/End2End/Groups/Genes/GetGenesForGroupTest.php @@ -7,7 +7,7 @@ use App\Modules\ExpertPanel\Models\ExpertPanel; use App\Modules\Group\Actions\GenesAdd; use App\Modules\User\Models\User; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Laravel\Sanctum\Sanctum; use Tests\Traits\SeedsHgncGenesAndDiseases; @@ -19,7 +19,7 @@ */ class GetGenesForGroupTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; use SeedsHgncGenesAndDiseases; public function setup():void diff --git a/tests/Feature/End2End/Groups/Genes/MailSentOnGeneListChangeTest.php b/tests/Feature/End2End/Groups/Genes/MailSentOnGeneListChangeTest.php index c5669e380..de9e39ff0 100644 --- a/tests/Feature/End2End/Groups/Genes/MailSentOnGeneListChangeTest.php +++ b/tests/Feature/End2End/Groups/Genes/MailSentOnGeneListChangeTest.php @@ -11,11 +11,11 @@ use Tests\Traits\SeedsHgncGenesAndDiseases; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class MailSentOnGeneListChangeTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; use SeedsHgncGenesAndDiseases; public function setup():void diff --git a/tests/Feature/End2End/Groups/Genes/RemoveGeneFromExpertPanelTest.php b/tests/Feature/End2End/Groups/Genes/RemoveGeneFromExpertPanelTest.php index 5ca8d74f6..a727ece4e 100644 --- a/tests/Feature/End2End/Groups/Genes/RemoveGeneFromExpertPanelTest.php +++ b/tests/Feature/End2End/Groups/Genes/RemoveGeneFromExpertPanelTest.php @@ -8,7 +8,7 @@ use App\Modules\User\Models\User; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; /** * @group groups @@ -18,7 +18,7 @@ */ class RemoveGeneFromExpertPanelTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Groups/Genes/UpdateGeneTest.php b/tests/Feature/End2End/Groups/Genes/UpdateGeneTest.php index 2653f8f43..4a7eed778 100644 --- a/tests/Feature/End2End/Groups/Genes/UpdateGeneTest.php +++ b/tests/Feature/End2End/Groups/Genes/UpdateGeneTest.php @@ -8,11 +8,11 @@ use Tests\Traits\SeedsHgncGenesAndDiseases; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class UpdateGeneTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; use SeedsHgncGenesAndDiseases; public function setup():void diff --git a/tests/Feature/End2End/Groups/GetSpecificationsTest.php b/tests/Feature/End2End/Groups/GetSpecificationsTest.php index b5fe7bf31..ef197ea58 100644 --- a/tests/Feature/End2End/Groups/GetSpecificationsTest.php +++ b/tests/Feature/End2End/Groups/GetSpecificationsTest.php @@ -10,11 +10,11 @@ use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; use App\Modules\ExpertPanel\Models\Specification; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class GetSpecificationsTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; private ExpertPanel $expertPanel; private Collection $specifications; diff --git a/tests/Feature/End2End/Groups/GetTasksTest.php b/tests/Feature/End2End/Groups/GetTasksTest.php index b01813b3e..116193426 100644 --- a/tests/Feature/End2End/Groups/GetTasksTest.php +++ b/tests/Feature/End2End/Groups/GetTasksTest.php @@ -10,11 +10,11 @@ use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; use Database\Seeders\TaskTypeSeeder; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class GetTasksTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Groups/GroupCommandTest.php b/tests/Feature/End2End/Groups/GroupCommandTest.php index 0cda15b79..e58eecfdb 100644 --- a/tests/Feature/End2End/Groups/GroupCommandTest.php +++ b/tests/Feature/End2End/Groups/GroupCommandTest.php @@ -6,11 +6,11 @@ use Laravel\Sanctum\Sanctum; use App\Modules\Group\Models\Group; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class GroupCommandTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; /** * @test */ diff --git a/tests/Feature/End2End/Groups/JudgementDeleteTest.php b/tests/Feature/End2End/Groups/JudgementDeleteTest.php index 2503f3c06..5880ce45b 100644 --- a/tests/Feature/End2End/Groups/JudgementDeleteTest.php +++ b/tests/Feature/End2End/Groups/JudgementDeleteTest.php @@ -6,7 +6,7 @@ use Laravel\Sanctum\Sanctum; use Illuminate\Testing\TestResponse; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\Modules\Group\Notifications\JudgementActivityNotification; class JudgementDeleteTest extends JudgementTest diff --git a/tests/Feature/End2End/Groups/JudgementTest.php b/tests/Feature/End2End/Groups/JudgementTest.php index d3e44a2e0..cfff6d06b 100644 --- a/tests/Feature/End2End/Groups/JudgementTest.php +++ b/tests/Feature/End2End/Groups/JudgementTest.php @@ -10,7 +10,7 @@ use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; use Database\Seeders\NextActionTypesTableSeeder; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Database\Seeders\SubmissionTypeAndStatusSeeder; use App\Modules\Group\Actions\ApplicationSubmitStep; use Database\Seeders\NextActionAssigneesTableSeeder; @@ -18,7 +18,7 @@ abstract class JudgementTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Groups/JudgementUpdateTest.php b/tests/Feature/End2End/Groups/JudgementUpdateTest.php index 6a10e6ea7..3ff3653b7 100644 --- a/tests/Feature/End2End/Groups/JudgementUpdateTest.php +++ b/tests/Feature/End2End/Groups/JudgementUpdateTest.php @@ -5,12 +5,12 @@ use Laravel\Sanctum\Sanctum; use Illuminate\Testing\TestResponse; use Illuminate\Support\Facades\Notification; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\Modules\Group\Notifications\JudgementActivityNotification; class JudgementUpdateTest extends JudgementTest { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Groups/ListActivityLogsTest.php b/tests/Feature/End2End/Groups/ListActivityLogsTest.php index 6fa58ee44..d51631a0f 100644 --- a/tests/Feature/End2End/Groups/ListActivityLogsTest.php +++ b/tests/Feature/End2End/Groups/ListActivityLogsTest.php @@ -5,7 +5,7 @@ use App\Models\Activity; use App\Modules\Group\Models\Group; use App\Modules\User\Models\User; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Illuminate\Foundation\Testing\WithFaker; use Laravel\Sanctum\Sanctum; use Tests\TestCase; @@ -16,7 +16,7 @@ */ class ListActivityLogsTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Groups/MemberUnretireTest.php b/tests/Feature/End2End/Groups/MemberUnretireTest.php index 32548e8f0..94df0666c 100644 --- a/tests/Feature/End2End/Groups/MemberUnretireTest.php +++ b/tests/Feature/End2End/Groups/MemberUnretireTest.php @@ -11,11 +11,11 @@ use App\Modules\Group\Models\Group; use App\Modules\Group\Models\GroupMember; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class MemberUnretireTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Groups/Members/AddGroupMemberTest.php b/tests/Feature/End2End/Groups/Members/AddGroupMemberTest.php index 769ba7312..bbc6ff487 100644 --- a/tests/Feature/End2End/Groups/Members/AddGroupMemberTest.php +++ b/tests/Feature/End2End/Groups/Members/AddGroupMemberTest.php @@ -16,7 +16,7 @@ use Illuminate\Foundation\Testing\WithFaker; use Illuminate\Support\Facades\Notification; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\Modules\Group\Notifications\AddedToGroupNotification; /** @@ -25,7 +25,7 @@ */ class AddGroupMemberTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; use SetsUpGroupPersonAndMember; public function setup():void diff --git a/tests/Feature/End2End/Groups/Members/AssignRoleToMemberTest.php b/tests/Feature/End2End/Groups/Members/AssignRoleToMemberTest.php index fda8ac65e..b87b5b3e2 100644 --- a/tests/Feature/End2End/Groups/Members/AssignRoleToMemberTest.php +++ b/tests/Feature/End2End/Groups/Members/AssignRoleToMemberTest.php @@ -6,10 +6,8 @@ use Laravel\Sanctum\Sanctum; use App\Modules\Group\Models\Group; use App\Modules\Person\Models\Person; -use App\Modules\Group\Actions\MemberAdd; use App\Modules\User\Models\User; -use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; /** * @group groups @@ -17,8 +15,15 @@ */ class AssignRoleToMemberTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; use SetsUpGroupPersonAndMember; + + private User $user; + private Group $group; + private Person $person; + private $url; + private $groupMember; + private $roles; public function setup():void { diff --git a/tests/Feature/End2End/Groups/Members/GrantMemberPermissionTest.php b/tests/Feature/End2End/Groups/Members/GrantMemberPermissionTest.php index 22bb55b74..573e98769 100644 --- a/tests/Feature/End2End/Groups/Members/GrantMemberPermissionTest.php +++ b/tests/Feature/End2End/Groups/Members/GrantMemberPermissionTest.php @@ -10,7 +10,7 @@ use App\Modules\Group\Actions\MemberAdd; use App\Modules\Group\Models\GroupMember; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Tests\Feature\End2End\Groups\Members\SetsUpGroupPersonAndMember; /** @@ -19,7 +19,7 @@ */ class GrantMemberPermissionTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; use SetsUpGroupPersonAndMember; public function setup():void diff --git a/tests/Feature/End2End/Groups/Members/InviteMemberTest.php b/tests/Feature/End2End/Groups/Members/InviteMemberTest.php index 5ee2ce5c5..e08e3a04a 100644 --- a/tests/Feature/End2End/Groups/Members/InviteMemberTest.php +++ b/tests/Feature/End2End/Groups/Members/InviteMemberTest.php @@ -10,7 +10,7 @@ use App\Modules\Group\Actions\MemberAdd; use Illuminate\Foundation\Testing\WithFaker; use Illuminate\Support\Facades\Notification; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\Modules\Group\Actions\MemberGrantPermissions; use App\Modules\Person\Notifications\InviteNotification; use App\Modules\Group\Notifications\AddedToGroupNotification; @@ -21,7 +21,7 @@ */ class InviteMemberTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Groups/Members/RemoveMemberTest.php b/tests/Feature/End2End/Groups/Members/RemoveMemberTest.php index 25d686ca9..b003e56b9 100644 --- a/tests/Feature/End2End/Groups/Members/RemoveMemberTest.php +++ b/tests/Feature/End2End/Groups/Members/RemoveMemberTest.php @@ -11,7 +11,7 @@ use App\Modules\Person\Models\Person; use App\Modules\Group\Actions\MemberAdd; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; /** * @group groups @@ -19,7 +19,7 @@ */ class RemoveMemberTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; use SetsUpGroupPersonAndMember; public function setup():void diff --git a/tests/Feature/End2End/Groups/Members/RemoveRoleFromMemberTest.php b/tests/Feature/End2End/Groups/Members/RemoveRoleFromMemberTest.php index fb96c5f2f..767367a44 100644 --- a/tests/Feature/End2End/Groups/Members/RemoveRoleFromMemberTest.php +++ b/tests/Feature/End2End/Groups/Members/RemoveRoleFromMemberTest.php @@ -10,7 +10,7 @@ use App\Modules\Group\Actions\MemberAdd; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\Group\Actions\MemberAssignRole; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; /** * @group groups @@ -18,7 +18,7 @@ */ class RemoveRoleFromMemberTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; use SetsUpGroupPersonAndMember; public function setup():void diff --git a/tests/Feature/End2End/Groups/Members/RetireMemberTest.php b/tests/Feature/End2End/Groups/Members/RetireMemberTest.php index 04a8b52f1..db1e07f7f 100644 --- a/tests/Feature/End2End/Groups/Members/RetireMemberTest.php +++ b/tests/Feature/End2End/Groups/Members/RetireMemberTest.php @@ -11,7 +11,7 @@ use App\Modules\Group\Actions\MemberAdd; use Carbon\Carbon; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; /** * @group groups @@ -19,7 +19,7 @@ */ class RetireMemberTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; use SetsUpGroupPersonAndMember; public function setup():void diff --git a/tests/Feature/End2End/Groups/Members/RevokeMemberPermissionTest.php b/tests/Feature/End2End/Groups/Members/RevokeMemberPermissionTest.php index 79741816c..dea897243 100644 --- a/tests/Feature/End2End/Groups/Members/RevokeMemberPermissionTest.php +++ b/tests/Feature/End2End/Groups/Members/RevokeMemberPermissionTest.php @@ -7,7 +7,7 @@ use App\Modules\User\Models\User; use App\Modules\Group\Models\GroupMember; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\Modules\Group\Actions\MemberGrantPermissions; use App\Modules\Group\Models\Group; @@ -17,7 +17,7 @@ */ class RevokeMemberPermissionTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; use SetsUpGroupPersonAndMember; public function setup():void diff --git a/tests/Feature/End2End/Groups/Members/UpdateMemberTest.php b/tests/Feature/End2End/Groups/Members/UpdateMemberTest.php index 6f9f18c8c..2abb4e240 100644 --- a/tests/Feature/End2End/Groups/Members/UpdateMemberTest.php +++ b/tests/Feature/End2End/Groups/Members/UpdateMemberTest.php @@ -7,11 +7,11 @@ use Laravel\Sanctum\Sanctum; use App\Modules\User\Models\User; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class UpdateMemberTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; use SetsUpGroupPersonAndMember; public function setup():void diff --git a/tests/Feature/End2End/Groups/PublishApplicationEventsTest.php b/tests/Feature/End2End/Groups/PublishApplicationEventsTest.php index 1273a550f..624384a6c 100644 --- a/tests/Feature/End2End/Groups/PublishApplicationEventsTest.php +++ b/tests/Feature/End2End/Groups/PublishApplicationEventsTest.php @@ -12,7 +12,7 @@ use App\Modules\ExpertPanel\Models\ExpertPanel; use App\Modules\Group\Actions\ExpertPanelAffiliationIdUpdate; use App\Modules\Group\Actions\ExpertPanelNameUpdate; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Tests\Traits\SeedsHgncGenesAndDiseases; /** @@ -20,7 +20,7 @@ */ class PublishApplicationEventsTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; use SeedsHgncGenesAndDiseases; protected $user, $expertPanel, $group; @@ -121,7 +121,7 @@ public function it_publishes_ep_info_updated_when_affiliation_id_added():void $this->assertDatabaseHas('stream_messages', [ 'topic' => config('dx.topics.outgoing.gpm-general-events'), 'message->event_type' => 'ep_info_updated', - 'message->data->expert_panel->affiliation_id' => '12345', + 'message->data->group->affiliation_id' => '12345', // 'sent_at' => null, ]); } @@ -137,7 +137,7 @@ public function it_publishes_ep_info_updated_when_name_changed():void $this->assertDatabaseHas('stream_messages', [ 'topic' => config('dx.topics.outgoing.gpm-general-events'), 'message->event_type' => 'ep_info_updated', - 'message->data->expert_panel->name' => 'new name GCEP', + 'message->data->group->name' => 'new name', // 'sent_at' => null, ]); } diff --git a/tests/Feature/End2End/Groups/RemoveSystemPermissionFromRemovedOrRetiredGroupMemberTest.php b/tests/Feature/End2End/Groups/RemoveSystemPermissionFromRemovedOrRetiredGroupMemberTest.php index 552d57a9e..ddcae7c49 100644 --- a/tests/Feature/End2End/Groups/RemoveSystemPermissionFromRemovedOrRetiredGroupMemberTest.php +++ b/tests/Feature/End2End/Groups/RemoveSystemPermissionFromRemovedOrRetiredGroupMemberTest.php @@ -12,7 +12,7 @@ use Illuminate\Foundation\Testing\WithFaker; use App\Modules\Person\Actions\PermissionAdd; use App\Modules\Person\Events\InviteRedeemed; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\Modules\Group\Actions\MemberAddSystemPermission; use App\Modules\Group\Actions\MemberRemove; use App\Modules\Group\Actions\MemberRemoveSystemPermission; @@ -23,7 +23,7 @@ class RemoveSystemPermissionFromRemovedOrRetiredGroupMemberTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Groups/SaveAnnualUpdateTest.php b/tests/Feature/End2End/Groups/SaveAnnualUpdateTest.php index c959b2b31..3ab1a96fc 100644 --- a/tests/Feature/End2End/Groups/SaveAnnualUpdateTest.php +++ b/tests/Feature/End2End/Groups/SaveAnnualUpdateTest.php @@ -9,11 +9,11 @@ use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; use Database\Seeders\AnnualUpdateWindowSeeder; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class SaveAnnualUpdateTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Groups/Submissions/RejectSubmissionTest.php b/tests/Feature/End2End/Groups/Submissions/RejectSubmissionTest.php index e5f58913f..aff815024 100644 --- a/tests/Feature/End2End/Groups/Submissions/RejectSubmissionTest.php +++ b/tests/Feature/End2End/Groups/Submissions/RejectSubmissionTest.php @@ -15,7 +15,7 @@ use App\Modules\ExpertPanel\Actions\ContactAdd; use App\Modules\ExpertPanel\Models\ExpertPanel; use Database\Seeders\NextActionTypesTableSeeder; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Database\Seeders\SubmissionTypeAndStatusSeeder; use Database\Seeders\NextActionAssigneesTableSeeder; use App\Modules\ExpertPanel\Models\NextActionAssignee; @@ -23,7 +23,7 @@ class RejectSubmissionTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; const NOTE = 'This is a note about the don\'t-call-it-a-rejection.'; diff --git a/tests/Feature/End2End/Groups/Submissions/SubmitApplicationStepTest.php b/tests/Feature/End2End/Groups/Submissions/SubmitApplicationStepTest.php index c080663d0..952d43a82 100644 --- a/tests/Feature/End2End/Groups/Submissions/SubmitApplicationStepTest.php +++ b/tests/Feature/End2End/Groups/Submissions/SubmitApplicationStepTest.php @@ -19,7 +19,7 @@ use App\Modules\ExpertPanel\Models\ExpertPanel; use Database\Seeders\NextActionTypesTableSeeder; use App\Mail\ApplicationStepSubmittedReceiptMail; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Database\Seeders\SubmissionTypeAndStatusSeeder; use Database\Seeders\NextActionAssigneesTableSeeder; use App\Modules\ExpertPanel\Actions\NextActionCreate; @@ -33,7 +33,7 @@ */ class SubmitApplicationStepTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; use SetsUpGroupPersonAndMember; public function setup():void diff --git a/tests/Feature/End2End/Groups/SubmitAnnualUpdateTest.php b/tests/Feature/End2End/Groups/SubmitAnnualUpdateTest.php index 3149911a0..6a6ee9a6c 100644 --- a/tests/Feature/End2End/Groups/SubmitAnnualUpdateTest.php +++ b/tests/Feature/End2End/Groups/SubmitAnnualUpdateTest.php @@ -10,11 +10,11 @@ use Illuminate\Foundation\Testing\WithFaker; use Database\Seeders\AnnualUpdateWindowSeeder; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class SubmitAnnualUpdateTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Groups/UpdateActivityLogTest.php b/tests/Feature/End2End/Groups/UpdateActivityLogTest.php index 2d1a28f32..bccb84b39 100644 --- a/tests/Feature/End2End/Groups/UpdateActivityLogTest.php +++ b/tests/Feature/End2End/Groups/UpdateActivityLogTest.php @@ -5,7 +5,7 @@ use App\Models\Activity; use App\Modules\Group\Models\Group; use App\Modules\User\Models\User; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Illuminate\Foundation\Testing\WithFaker; use Laravel\Sanctum\Sanctum; use Tests\TestCase; @@ -16,7 +16,7 @@ */ class UpdateActivityLogTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Groups/UpdateAffiliationIdTest.php b/tests/Feature/End2End/Groups/UpdateAffiliationIdTest.php index 523dcd940..e65f4f59b 100644 --- a/tests/Feature/End2End/Groups/UpdateAffiliationIdTest.php +++ b/tests/Feature/End2End/Groups/UpdateAffiliationIdTest.php @@ -6,11 +6,11 @@ use Laravel\Sanctum\Sanctum; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class UpdateAffiliationIdTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Groups/UpdateCurationProcessTest.php b/tests/Feature/End2End/Groups/UpdateCurationProcessTest.php index 844bca0ad..1022e5ddc 100644 --- a/tests/Feature/End2End/Groups/UpdateCurationProcessTest.php +++ b/tests/Feature/End2End/Groups/UpdateCurationProcessTest.php @@ -8,11 +8,11 @@ use App\Modules\User\Models\User; use Database\Seeders\CurationReviewProtocolsSeeder; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class UpdateCurationProcessTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Groups/UpdateEpNameTest.php b/tests/Feature/End2End/Groups/UpdateEpNameTest.php index aa155b9e0..693d85e81 100644 --- a/tests/Feature/End2End/Groups/UpdateEpNameTest.php +++ b/tests/Feature/End2End/Groups/UpdateEpNameTest.php @@ -4,14 +4,14 @@ use App\Modules\ExpertPanel\Models\ExpertPanel; use App\Modules\User\Models\User; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Illuminate\Foundation\Testing\WithFaker; use Laravel\Sanctum\Sanctum; use Tests\TestCase; class UpdateEpNameTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; use WithFaker; public function setup():void diff --git a/tests/Feature/End2End/Groups/UpdateGroupNameTest.php b/tests/Feature/End2End/Groups/UpdateGroupNameTest.php index ccf447a11..d474132c1 100644 --- a/tests/Feature/End2End/Groups/UpdateGroupNameTest.php +++ b/tests/Feature/End2End/Groups/UpdateGroupNameTest.php @@ -7,11 +7,11 @@ use App\Modules\User\Models\User; use App\Modules\Group\Models\Group; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class UpdateGroupNameTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Groups/UpdateGroupParentTest.php b/tests/Feature/End2End/Groups/UpdateGroupParentTest.php index 6ed8697c4..4babb1fc2 100644 --- a/tests/Feature/End2End/Groups/UpdateGroupParentTest.php +++ b/tests/Feature/End2End/Groups/UpdateGroupParentTest.php @@ -7,11 +7,11 @@ use App\Modules\User\Models\User; use App\Modules\Group\Models\Group; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class UpdateGroupParentTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; private $user, $parent, $group; diff --git a/tests/Feature/End2End/Groups/UpdateGroupStatusTest.php b/tests/Feature/End2End/Groups/UpdateGroupStatusTest.php index 3a19092ae..ef1f0c921 100644 --- a/tests/Feature/End2End/Groups/UpdateGroupStatusTest.php +++ b/tests/Feature/End2End/Groups/UpdateGroupStatusTest.php @@ -7,11 +7,11 @@ use App\Modules\User\Models\User; use App\Modules\Group\Models\Group; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class UpdateGroupStatusTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Groups/UpdateMembershipDescriptionTest.php b/tests/Feature/End2End/Groups/UpdateMembershipDescriptionTest.php index dda667494..036a4fc36 100644 --- a/tests/Feature/End2End/Groups/UpdateMembershipDescriptionTest.php +++ b/tests/Feature/End2End/Groups/UpdateMembershipDescriptionTest.php @@ -8,11 +8,11 @@ use App\Modules\Group\Models\Group; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class UpdateMembershipDescriptionTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Groups/UpdateScopeDescriptionTest.php b/tests/Feature/End2End/Groups/UpdateScopeDescriptionTest.php index 58017a830..172f6428f 100644 --- a/tests/Feature/End2End/Groups/UpdateScopeDescriptionTest.php +++ b/tests/Feature/End2End/Groups/UpdateScopeDescriptionTest.php @@ -8,11 +8,11 @@ use App\Modules\Group\Models\Group; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class UpdateScopeDescriptionTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/InviteReminderTest.php b/tests/Feature/End2End/InviteReminderTest.php index 0fb4d0cb5..f4fd0c357 100644 --- a/tests/Feature/End2End/InviteReminderTest.php +++ b/tests/Feature/End2End/InviteReminderTest.php @@ -13,11 +13,11 @@ use Illuminate\Foundation\Testing\WithFaker; use Illuminate\Support\Facades\Notification; use App\Notifications\InviteReminderNotification; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class InviteReminderTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Mail/RenderUserDefinedTemplateTest.php b/tests/Feature/End2End/Mail/RenderUserDefinedTemplateTest.php index 8cdf2b405..af0999d03 100644 --- a/tests/Feature/End2End/Mail/RenderUserDefinedTemplateTest.php +++ b/tests/Feature/End2End/Mail/RenderUserDefinedTemplateTest.php @@ -6,7 +6,7 @@ use Laravel\Sanctum\Sanctum; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\Mail\UserDefinedMailTemplates\InitialApprovalMailTemplate; use App\Mail\UserDefinedMailTemplates\SpecificationDraftMailTemplate; use App\Mail\UserDefinedMailTemplates\SpecificationPilotMailTemplate; @@ -15,7 +15,7 @@ class RenderUserDefinedTemplateTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/MarkNotificationReadTest.php b/tests/Feature/End2End/MarkNotificationReadTest.php index 6492344ca..605c70dfe 100644 --- a/tests/Feature/End2End/MarkNotificationReadTest.php +++ b/tests/Feature/End2End/MarkNotificationReadTest.php @@ -9,11 +9,11 @@ use Tests\Stubs\TestDatabaseNotification; use Illuminate\Foundation\Testing\WithFaker; use Illuminate\Support\Facades\Notification; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class MarkNotificationReadTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Person/Credentials/CreateCredentialsTest.php b/tests/Feature/End2End/Person/Credentials/CreateCredentialsTest.php index 9633da80c..4a3cc4b40 100644 --- a/tests/Feature/End2End/Person/Credentials/CreateCredentialsTest.php +++ b/tests/Feature/End2End/Person/Credentials/CreateCredentialsTest.php @@ -7,14 +7,14 @@ use Laravel\Sanctum\Sanctum; use Illuminate\Testing\TestResponse; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; /** * @group credentials */ class CreateCredentialsTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Person/Credentials/DeleteCredentialTest.php b/tests/Feature/End2End/Person/Credentials/DeleteCredentialTest.php index d1daf4753..65f420173 100644 --- a/tests/Feature/End2End/Person/Credentials/DeleteCredentialTest.php +++ b/tests/Feature/End2End/Person/Credentials/DeleteCredentialTest.php @@ -7,14 +7,14 @@ use Illuminate\Testing\TestResponse; use App\Modules\Person\Models\Person; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; /** * @group credentials */ class DeleteCredentialTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Person/Credentials/MergeCredentialsTest.php b/tests/Feature/End2End/Person/Credentials/MergeCredentialsTest.php index fc9947a77..b2719399b 100644 --- a/tests/Feature/End2End/Person/Credentials/MergeCredentialsTest.php +++ b/tests/Feature/End2End/Person/Credentials/MergeCredentialsTest.php @@ -7,14 +7,14 @@ use Illuminate\Testing\TestResponse; use App\Modules\Person\Models\Person; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; /** * @group credentials */ class MergeCredentialsTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Person/Credentials/SearchCredentialsTest.php b/tests/Feature/End2End/Person/Credentials/SearchCredentialsTest.php index 12985ccc1..0dbe6ed65 100644 --- a/tests/Feature/End2End/Person/Credentials/SearchCredentialsTest.php +++ b/tests/Feature/End2End/Person/Credentials/SearchCredentialsTest.php @@ -7,14 +7,14 @@ use Database\Seeders\CredentialSeeder; use Illuminate\Testing\TestResponse; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; /** * @group credentials */ class SearchCredentialsTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Person/Credentials/UpdateCredentialTest.php b/tests/Feature/End2End/Person/Credentials/UpdateCredentialTest.php index 00637e81a..edd411b58 100644 --- a/tests/Feature/End2End/Person/Credentials/UpdateCredentialTest.php +++ b/tests/Feature/End2End/Person/Credentials/UpdateCredentialTest.php @@ -6,14 +6,14 @@ use App\Models\Credential; use Illuminate\Testing\TestResponse; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; /** * @group credentials */ class UpdateCredentialTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Person/Expertises/CreateExpertisesTest.php b/tests/Feature/End2End/Person/Expertises/CreateExpertisesTest.php index e6d2acdf2..dda8eb4da 100644 --- a/tests/Feature/End2End/Person/Expertises/CreateExpertisesTest.php +++ b/tests/Feature/End2End/Person/Expertises/CreateExpertisesTest.php @@ -7,14 +7,14 @@ use Laravel\Sanctum\Sanctum; use Illuminate\Testing\TestResponse; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; /** * @group expertises */ class CreateExpertisesTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Person/Expertises/DeleteExpertiseTest.php b/tests/Feature/End2End/Person/Expertises/DeleteExpertiseTest.php index 75da90bf5..10158b4d6 100644 --- a/tests/Feature/End2End/Person/Expertises/DeleteExpertiseTest.php +++ b/tests/Feature/End2End/Person/Expertises/DeleteExpertiseTest.php @@ -7,14 +7,14 @@ use Illuminate\Testing\TestResponse; use App\Modules\Person\Models\Person; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; /** * @group expertises */ class DeleteExpertiseTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Person/Expertises/MergeExpertisesTest.php b/tests/Feature/End2End/Person/Expertises/MergeExpertisesTest.php index a7761d794..72eb301e5 100644 --- a/tests/Feature/End2End/Person/Expertises/MergeExpertisesTest.php +++ b/tests/Feature/End2End/Person/Expertises/MergeExpertisesTest.php @@ -7,14 +7,14 @@ use Illuminate\Testing\TestResponse; use App\Modules\Person\Models\Person; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; /** * @group expertises */ class MergeExpertisesTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Person/Expertises/SearchExpertisesTest.php b/tests/Feature/End2End/Person/Expertises/SearchExpertisesTest.php index 3320775b1..6cef0fa3d 100644 --- a/tests/Feature/End2End/Person/Expertises/SearchExpertisesTest.php +++ b/tests/Feature/End2End/Person/Expertises/SearchExpertisesTest.php @@ -7,14 +7,14 @@ use Database\Seeders\ExpertiseSeeder; use Illuminate\Testing\TestResponse; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; /** * @group expertises */ class SearchExpertisesTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Person/Expertises/UpdateExpertiseTest.php b/tests/Feature/End2End/Person/Expertises/UpdateExpertiseTest.php index 602449d9b..725017d76 100644 --- a/tests/Feature/End2End/Person/Expertises/UpdateExpertiseTest.php +++ b/tests/Feature/End2End/Person/Expertises/UpdateExpertiseTest.php @@ -6,14 +6,14 @@ use App\Models\Expertise; use Illuminate\Testing\TestResponse; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; /** * @group expertises */ class UpdateExpertiseTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Person/GetNotificationsTest.php b/tests/Feature/End2End/Person/GetNotificationsTest.php index a3c96fdf4..a49f2e3dd 100644 --- a/tests/Feature/End2End/Person/GetNotificationsTest.php +++ b/tests/Feature/End2End/Person/GetNotificationsTest.php @@ -6,13 +6,13 @@ use Tests\TestCase; use Laravel\Sanctum\Sanctum; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Illuminate\Support\Facades\Notification; use Tests\Stubs\TestDatabaseNotification; class GetNotificationsTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Person/InstitutionDeleteTest.php b/tests/Feature/End2End/Person/InstitutionDeleteTest.php index bcdf91cc3..a112185fc 100644 --- a/tests/Feature/End2End/Person/InstitutionDeleteTest.php +++ b/tests/Feature/End2End/Person/InstitutionDeleteTest.php @@ -8,11 +8,11 @@ use Illuminate\Testing\TestResponse; use App\Modules\Person\Models\Institution; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class InstitutionDeleteTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Person/InstitutionMarkApprovedTest.php b/tests/Feature/End2End/Person/InstitutionMarkApprovedTest.php index af1706df0..04c3c1f41 100644 --- a/tests/Feature/End2End/Person/InstitutionMarkApprovedTest.php +++ b/tests/Feature/End2End/Person/InstitutionMarkApprovedTest.php @@ -7,11 +7,11 @@ use Laravel\Sanctum\Sanctum; use App\Modules\Person\Models\Institution; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class InstitutionMarkApprovedTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Person/InstitutionUpdateTest.php b/tests/Feature/End2End/Person/InstitutionUpdateTest.php index e9b98c9e1..ecf5233c2 100644 --- a/tests/Feature/End2End/Person/InstitutionUpdateTest.php +++ b/tests/Feature/End2End/Person/InstitutionUpdateTest.php @@ -7,11 +7,11 @@ use App\Modules\Person\Models\Country; use App\Modules\Person\Models\Institution; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class InstitutionUpdateTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Person/ListPeopleTest.php b/tests/Feature/End2End/Person/ListPeopleTest.php index b0f7af366..ce79c9d6b 100644 --- a/tests/Feature/End2End/Person/ListPeopleTest.php +++ b/tests/Feature/End2End/Person/ListPeopleTest.php @@ -7,14 +7,14 @@ use App\Modules\User\Models\User; use App\Modules\Person\Models\Person; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; /** * @group people */ class ListPeopleTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; const URL = '/api/people'; diff --git a/tests/Feature/End2End/Person/MergeInstitutionsTest.php b/tests/Feature/End2End/Person/MergeInstitutionsTest.php index 5efd5e184..ed4532d6e 100644 --- a/tests/Feature/End2End/Person/MergeInstitutionsTest.php +++ b/tests/Feature/End2End/Person/MergeInstitutionsTest.php @@ -7,11 +7,11 @@ use App\Modules\Person\Models\Person; use App\Modules\Person\Models\Institution; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class MergeInstitutionsTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Person/PersonDeleteTest.php b/tests/Feature/End2End/Person/PersonDeleteTest.php index 2c4c8f332..4777819d7 100644 --- a/tests/Feature/End2End/Person/PersonDeleteTest.php +++ b/tests/Feature/End2End/Person/PersonDeleteTest.php @@ -10,11 +10,11 @@ use App\Modules\Group\Actions\MemberAdd; use Carbon\Carbon; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class PersonDeleteTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; use TestEventPublished; public function setup():void diff --git a/tests/Feature/End2End/Person/PersonDetailTest.php b/tests/Feature/End2End/Person/PersonDetailTest.php index 76479797f..99f5a6b0d 100644 --- a/tests/Feature/End2End/Person/PersonDetailTest.php +++ b/tests/Feature/End2End/Person/PersonDetailTest.php @@ -8,14 +8,14 @@ use App\Modules\User\Models\User; use App\Modules\Person\Models\Person; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; /** * @group people */ class PersonDetailTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Person/PersonMergeTest.php b/tests/Feature/End2End/Person/PersonMergeTest.php index 50c502243..ea92b7745 100644 --- a/tests/Feature/End2End/Person/PersonMergeTest.php +++ b/tests/Feature/End2End/Person/PersonMergeTest.php @@ -13,11 +13,11 @@ use App\Modules\Person\Models\Person; use App\Modules\Group\Actions\MemberAdd; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class PersonMergeTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; private $user, $group1, $group2, $person1, $person2; diff --git a/tests/Feature/End2End/Person/PersonPhotoStoreTest.php b/tests/Feature/End2End/Person/PersonPhotoStoreTest.php index 17e96f2ac..ac50ba5a4 100644 --- a/tests/Feature/End2End/Person/PersonPhotoStoreTest.php +++ b/tests/Feature/End2End/Person/PersonPhotoStoreTest.php @@ -8,11 +8,11 @@ use App\Modules\Person\Models\Person; use Illuminate\Support\Facades\Storage; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class PersonPhotoStoreTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; use TestEventPublished; public function setup():void diff --git a/tests/Feature/End2End/Person/RedeemInviteTest.php b/tests/Feature/End2End/Person/RedeemInviteTest.php index ae665eb59..af226f834 100644 --- a/tests/Feature/End2End/Person/RedeemInviteTest.php +++ b/tests/Feature/End2End/Person/RedeemInviteTest.php @@ -8,11 +8,11 @@ use App\Modules\Person\Models\Invite; use App\Modules\Person\Models\Person; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class RedeemInviteTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; const URL = '/api/people/invites'; public function setup():void diff --git a/tests/Feature/End2End/Person/ResetInviteTest.php b/tests/Feature/End2End/Person/ResetInviteTest.php index d63cfe9c6..99f32bd74 100644 --- a/tests/Feature/End2End/Person/ResetInviteTest.php +++ b/tests/Feature/End2End/Person/ResetInviteTest.php @@ -7,11 +7,11 @@ use Illuminate\Support\Carbon; use App\Modules\Person\Models\Invite; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class ResetInviteTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Person/UpdateProfileTest.php b/tests/Feature/End2End/Person/UpdateProfileTest.php index d8c855374..09bbb0cec 100644 --- a/tests/Feature/End2End/Person/UpdateProfileTest.php +++ b/tests/Feature/End2End/Person/UpdateProfileTest.php @@ -16,7 +16,7 @@ use App\Modules\Person\Models\Institution; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\Group\Actions\MemberAssignRole; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\Modules\Group\Actions\MemberGrantPermissions; use Tests\Feature\End2End\Person\TestEventPublished; @@ -27,7 +27,7 @@ */ class UpdateProfileTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; use WithFaker; private $institution; diff --git a/tests/Feature/End2End/PersonEndpointTest.php b/tests/Feature/End2End/PersonEndpointTest.php index 52e209fa2..64a95c608 100644 --- a/tests/Feature/End2End/PersonEndpointTest.php +++ b/tests/Feature/End2End/PersonEndpointTest.php @@ -7,7 +7,7 @@ use Laravel\Sanctum\Sanctum; use App\Modules\Person\Models\Person; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Ramsey\Uuid\Uuid; /** @@ -15,7 +15,7 @@ */ class PersonEndpointTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/ResendMailTest.php b/tests/Feature/End2End/ResendMailTest.php index 2fe24bd75..712c823ef 100644 --- a/tests/Feature/End2End/ResendMailTest.php +++ b/tests/Feature/End2End/ResendMailTest.php @@ -11,11 +11,11 @@ use Tests\Stubs\TestMailNotification; use Illuminate\Foundation\Testing\WithFaker; use Illuminate\Support\Facades\Notification; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class ResendMailTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; private $user, $mail; diff --git a/tests/Feature/End2End/SendSubmissionDigestNotificationsTest.php b/tests/Feature/End2End/SendSubmissionDigestNotificationsTest.php index ef8125034..8073ffd04 100644 --- a/tests/Feature/End2End/SendSubmissionDigestNotificationsTest.php +++ b/tests/Feature/End2End/SendSubmissionDigestNotificationsTest.php @@ -13,7 +13,7 @@ use App\Modules\ExpertPanel\Models\ExpertPanel; use App\Notifications\ApprovalDigestNotification; use App\Actions\SendSubmissionDigestNotifications; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\Modules\Group\Notifications\ApprovalReminder; use App\Notifications\UserDefinedDatabaseNotification; use App\Modules\Group\Notifications\CommentActivityNotification; @@ -21,7 +21,7 @@ class SendSubmissionDigestNotificationsTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/SyncGenesToGcepTest.php b/tests/Feature/End2End/SyncGenesToGcepTest.php index ee17fa2d3..a9f86d6f0 100644 --- a/tests/Feature/End2End/SyncGenesToGcepTest.php +++ b/tests/Feature/End2End/SyncGenesToGcepTest.php @@ -9,7 +9,7 @@ use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; use Carbon\Carbon; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Tests\Traits\SeedsHgncGenesAndDiseases; /** @@ -20,7 +20,7 @@ */ class SyncGenesToGcepTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; use SeedsHgncGenesAndDiseases; public function setup():void diff --git a/tests/Feature/End2End/Tasks/TaskIndexTest.php b/tests/Feature/End2End/Tasks/TaskIndexTest.php index 3d7c664a4..0361de08b 100644 --- a/tests/Feature/End2End/Tasks/TaskIndexTest.php +++ b/tests/Feature/End2End/Tasks/TaskIndexTest.php @@ -7,12 +7,12 @@ use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; use Database\Seeders\TaskTypeSeeder; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Laravel\Sanctum\Sanctum; class TaskIndexTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/End2End/Users/ArtisanCreateUserTest.php b/tests/Feature/End2End/Users/ArtisanCreateUserTest.php index f6cf917f7..996d6407d 100644 --- a/tests/Feature/End2End/Users/ArtisanCreateUserTest.php +++ b/tests/Feature/End2End/Users/ArtisanCreateUserTest.php @@ -5,11 +5,11 @@ use Tests\TestCase; use App\Modules\User\Models\User; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class ArtisanCreateUserTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; protected $admin; protected $name; diff --git a/tests/Feature/End2End/Users/UpdateUserRolesAndPermissionsTest.php b/tests/Feature/End2End/Users/UpdateUserRolesAndPermissionsTest.php index 62978108c..53e194a73 100644 --- a/tests/Feature/End2End/Users/UpdateUserRolesAndPermissionsTest.php +++ b/tests/Feature/End2End/Users/UpdateUserRolesAndPermissionsTest.php @@ -7,11 +7,11 @@ use Database\Seeders\RolesAndPermissionsSeeder; use Laravel\Sanctum\Sanctum; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class UpdateUserRolesAndPermissionsTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/Http/Controllers/ScheduleControllerTest.php b/tests/Feature/Http/Controllers/ScheduleControllerTest.php new file mode 100644 index 000000000..0b6bebe9d --- /dev/null +++ b/tests/Feature/Http/Controllers/ScheduleControllerTest.php @@ -0,0 +1,20 @@ +get('/'); + + $response->assertStatus(200); + } +} diff --git a/tests/Feature/Integration/DX/Actions/ClassifiedRulesApprovedProcessorTest.php b/tests/Feature/Integration/DX/Actions/ClassifiedRulesApprovedProcessorTest.php index 1fdfd41fa..821795c97 100644 --- a/tests/Feature/Integration/DX/Actions/ClassifiedRulesApprovedProcessorTest.php +++ b/tests/Feature/Integration/DX/Actions/ClassifiedRulesApprovedProcessorTest.php @@ -7,13 +7,13 @@ use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; use App\DataExchange\Models\IncomingStreamMessage; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\DataExchange\Exceptions\DataSynchronizationException; use App\DataExchange\Actions\ClassifiedRulesApprovedProcessor; class ClassifiedRulesApprovedProcessorTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; use WithFaker; private $expertPanel; diff --git a/tests/Feature/Integration/DX/Actions/CspecDataSyncProcessorTest.php b/tests/Feature/Integration/DX/Actions/CspecDataSyncProcessorTest.php index 2a525d417..08f7b6f41 100644 --- a/tests/Feature/Integration/DX/Actions/CspecDataSyncProcessorTest.php +++ b/tests/Feature/Integration/DX/Actions/CspecDataSyncProcessorTest.php @@ -12,12 +12,12 @@ use Database\Seeders\SpecificationStatusSeeder; use App\Modules\ExpertPanel\Models\Specification; use App\DataExchange\Models\IncomingStreamMessage; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\DataExchange\Actions\CspecDataSyncProcessor; class CspecDataSyncProcessorTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; protected IncomingStreamMessage $message; protected ExpertPanel $expertPanel; diff --git a/tests/Feature/Integration/DX/Actions/DxConsumeTest.php b/tests/Feature/Integration/DX/Actions/DxConsumeTest.php index 961c52937..7a70d6028 100644 --- a/tests/Feature/Integration/DX/Actions/DxConsumeTest.php +++ b/tests/Feature/Integration/DX/Actions/DxConsumeTest.php @@ -10,14 +10,14 @@ use App\DataExchange\Contracts\MessageStream; use Lorisleiva\Actions\Decorators\JobDecorator; use App\DataExchange\Contracts\MessageProcessor; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; /** * @group dx */ class DxConsumeTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; protected array $messages; diff --git a/tests/Feature/Integration/DX/Actions/IncomingMessageStoreTest.php b/tests/Feature/Integration/DX/Actions/IncomingMessageStoreTest.php index 2cdcc0f1b..55d653d84 100644 --- a/tests/Feature/Integration/DX/Actions/IncomingMessageStoreTest.php +++ b/tests/Feature/Integration/DX/Actions/IncomingMessageStoreTest.php @@ -4,13 +4,13 @@ use App\DataExchange\Actions\IncomingMessageStore; use App\DataExchange\DxMessage; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Illuminate\Foundation\Testing\WithFaker; use Tests\TestCase; class IncomingMessageStoreTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; /** * @test diff --git a/tests/Feature/Integration/DX/Actions/PilotRulesApprovedProcessorTest.php b/tests/Feature/Integration/DX/Actions/PilotRulesApprovedProcessorTest.php index 3f509f908..7d77fa469 100644 --- a/tests/Feature/Integration/DX/Actions/PilotRulesApprovedProcessorTest.php +++ b/tests/Feature/Integration/DX/Actions/PilotRulesApprovedProcessorTest.php @@ -9,13 +9,13 @@ use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; use App\DataExchange\Models\IncomingStreamMessage; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\DataExchange\Actions\PilotRulesApprovedProcessor; use App\DataExchange\Exceptions\DataSynchronizationException; class PilotRulesApprovedProcessorTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; use WithFaker; private $expertPanel; diff --git a/tests/Feature/Integration/ImpersonateSearchTest.php b/tests/Feature/Integration/ImpersonateSearchTest.php index 466273b90..1587547d4 100644 --- a/tests/Feature/Integration/ImpersonateSearchTest.php +++ b/tests/Feature/Integration/ImpersonateSearchTest.php @@ -4,14 +4,14 @@ use App\Models\Role; use App\Modules\User\Models\User; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Illuminate\Foundation\Testing\WithFaker; use Laravel\Sanctum\Sanctum; use Tests\TestCase; class ImpersonateSearchTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/Integration/Modules/Application/Actions/ApplicationCompleteTest.php b/tests/Feature/Integration/Modules/Application/Actions/ApplicationCompleteTest.php index 769110afb..80960422a 100644 --- a/tests/Feature/Integration/Modules/Application/Actions/ApplicationCompleteTest.php +++ b/tests/Feature/Integration/Modules/Application/Actions/ApplicationCompleteTest.php @@ -7,13 +7,13 @@ use Illuminate\Support\Facades\Event; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\Modules\ExpertPanel\Actions\ApplicationComplete; use App\Modules\ExpertPanel\Events\ApplicationCompleted; class ApplicationCompleteTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/Integration/Modules/Application/Actions/ApplicationDocumentAddTest.php b/tests/Feature/Integration/Modules/Application/Actions/ApplicationDocumentAddTest.php index d516461a9..63b4fe7a7 100644 --- a/tests/Feature/Integration/Modules/Application/Actions/ApplicationDocumentAddTest.php +++ b/tests/Feature/Integration/Modules/Application/Actions/ApplicationDocumentAddTest.php @@ -6,13 +6,13 @@ use App\Models\Document; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\Modules\ExpertPanel\Actions\ApplicationDocumentAdd; use Carbon\Carbon; class ApplicationDocumentAddTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/Integration/Modules/Application/Actions/CompleteNextActionTest.php b/tests/Feature/Integration/Modules/Application/Actions/CompleteNextActionTest.php index 6ccb7abdb..f1f42dd60 100644 --- a/tests/Feature/Integration/Modules/Application/Actions/CompleteNextActionTest.php +++ b/tests/Feature/Integration/Modules/Application/Actions/CompleteNextActionTest.php @@ -8,7 +8,7 @@ use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\NextAction; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Database\Seeders\NextActionAssigneesTableSeeder; use App\Modules\ExpertPanel\Actions\NextActionCreate; use App\Modules\ExpertPanel\Actions\NextActionComplete; @@ -16,7 +16,7 @@ class CompleteNextActionTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/Integration/Modules/Application/Actions/ContactAddTest.php b/tests/Feature/Integration/Modules/Application/Actions/ContactAddTest.php index ebe350efc..f27b9725a 100644 --- a/tests/Feature/Integration/Modules/Application/Actions/ContactAddTest.php +++ b/tests/Feature/Integration/Modules/Application/Actions/ContactAddTest.php @@ -9,7 +9,7 @@ use App\Modules\ExpertPanel\Actions\ContactAdd; use App\Modules\ExpertPanel\Models\ExpertPanel; use App\Modules\ExpertPanel\Events\ContactAdded; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; /** * @group applications @@ -19,7 +19,7 @@ */ class ContactAddTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/Integration/Modules/Application/Actions/ContactRemoveTest.php b/tests/Feature/Integration/Modules/Application/Actions/ContactRemoveTest.php index 618db5890..8dac7df1b 100644 --- a/tests/Feature/Integration/Modules/Application/Actions/ContactRemoveTest.php +++ b/tests/Feature/Integration/Modules/Application/Actions/ContactRemoveTest.php @@ -8,7 +8,7 @@ use App\Modules\ExpertPanel\Actions\ContactAdd; use App\Modules\ExpertPanel\Models\ExpertPanel; use App\Modules\ExpertPanel\Actions\ContactRemove; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; /** * @group applications @@ -17,7 +17,7 @@ */ class ContactRemoveTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/Integration/Modules/Application/Actions/NextActionCreateTest.php b/tests/Feature/Integration/Modules/Application/Actions/NextActionCreateTest.php index bfa1e6fc5..295d70d09 100644 --- a/tests/Feature/Integration/Modules/Application/Actions/NextActionCreateTest.php +++ b/tests/Feature/Integration/Modules/Application/Actions/NextActionCreateTest.php @@ -9,7 +9,7 @@ use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; use App\Modules\ExpertPanel\Actions\NextActionCreate; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\Modules\ExpertPanel\Events\NextActionAdded; use Database\Seeders\NextActionAssigneesTableSeeder; @@ -18,7 +18,7 @@ */ class NextActionCreateTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/Integration/Modules/Application/Actions/StepApproveTest.php b/tests/Feature/Integration/Modules/Application/Actions/StepApproveTest.php index 4340166a8..a62ba75b1 100644 --- a/tests/Feature/Integration/Modules/Application/Actions/StepApproveTest.php +++ b/tests/Feature/Integration/Modules/Application/Actions/StepApproveTest.php @@ -7,11 +7,11 @@ use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Actions\StepApprove; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class StepApproveTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; /** * @test diff --git a/tests/Feature/Integration/Modules/Application/Models/ExpertPanelTest.php b/tests/Feature/Integration/Modules/Application/Models/ExpertPanelTest.php index 57b069725..ff94ed252 100644 --- a/tests/Feature/Integration/Modules/Application/Models/ExpertPanelTest.php +++ b/tests/Feature/Integration/Modules/Application/Models/ExpertPanelTest.php @@ -8,7 +8,7 @@ use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Event; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\Modules\ExpertPanel\Events\ApplicationCompleted; use App\Modules\ExpertPanel\Events\ExpertPanelAttributesUpdated; @@ -18,7 +18,7 @@ */ class ExpertPanelTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/Integration/Modules/ExpertPanel/Actions/ExpertPanelCreateTest.php b/tests/Feature/Integration/Modules/ExpertPanel/Actions/ExpertPanelCreateTest.php index 9e5babcbc..be89347db 100644 --- a/tests/Feature/Integration/Modules/ExpertPanel/Actions/ExpertPanelCreateTest.php +++ b/tests/Feature/Integration/Modules/ExpertPanel/Actions/ExpertPanelCreateTest.php @@ -10,14 +10,14 @@ use Illuminate\Support\Facades\Event; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\Modules\ExpertPanel\Jobs\InitiateApplication; use App\Modules\ExpertPanel\Actions\ExpertPanelCreate; use App\Modules\ExpertPanel\Events\ApplicationInitiated; class ExpertPanelCreateTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/Integration/Modules/ExpertPanel/Actions/ExpertPanelUpdateAttributesTest.php b/tests/Feature/Integration/Modules/ExpertPanel/Actions/ExpertPanelUpdateAttributesTest.php index b4465c27d..83007e6d4 100644 --- a/tests/Feature/Integration/Modules/ExpertPanel/Actions/ExpertPanelUpdateAttributesTest.php +++ b/tests/Feature/Integration/Modules/ExpertPanel/Actions/ExpertPanelUpdateAttributesTest.php @@ -7,13 +7,13 @@ use Illuminate\Support\Facades\Event; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\Modules\ExpertPanel\Actions\ExpertPanelUpdateAttributes; use App\Modules\ExpertPanel\Events\ExpertPanelAttributesUpdated; class ExpertPanelUpdateAttributesTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/Integration/Modules/Group/Actions/JudgementCreateTest.php b/tests/Feature/Integration/Modules/Group/Actions/JudgementCreateTest.php index 16aeae84d..21585e408 100644 --- a/tests/Feature/Integration/Modules/Group/Actions/JudgementCreateTest.php +++ b/tests/Feature/Integration/Modules/Group/Actions/JudgementCreateTest.php @@ -13,11 +13,11 @@ use App\Modules\Group\Events\JudgementCreated; use App\Modules\Group\Models\SubmissionStatus; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class JudgementCreateTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; private $expertPanel, $person, $submission; diff --git a/tests/Feature/Integration/Modules/Person/Actions/PersonCreateTest.php b/tests/Feature/Integration/Modules/Person/Actions/PersonCreateTest.php index 24d95b532..fecc29a87 100644 --- a/tests/Feature/Integration/Modules/Person/Actions/PersonCreateTest.php +++ b/tests/Feature/Integration/Modules/Person/Actions/PersonCreateTest.php @@ -6,14 +6,14 @@ use Tests\TestCase; use App\Modules\Person\Models\Person; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Tests\Feature\End2End\Person\TestEventPublished; class PersonCreateTest extends TestCase { use WithFaker; use TestEventPublished; - use RefreshDatabase; + use FastRefreshDatabase; /** * @test diff --git a/tests/Feature/Integration/Modules/Person/Models/CredentialTest.php b/tests/Feature/Integration/Modules/Person/Models/CredentialTest.php index d7a9a6e0d..235931daa 100644 --- a/tests/Feature/Integration/Modules/Person/Models/CredentialTest.php +++ b/tests/Feature/Integration/Modules/Person/Models/CredentialTest.php @@ -6,7 +6,7 @@ use App\Models\Credential; use App\ControlledVocabularies\Synonym; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\ControlledVocabularies\HasSynonymInterface; /** @@ -14,7 +14,7 @@ */ class CredentialTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; /** * @test diff --git a/tests/Feature/Integration/Modules/Person/Models/InviteTest.php b/tests/Feature/Integration/Modules/Person/Models/InviteTest.php index 91cf6a26d..796ff8198 100644 --- a/tests/Feature/Integration/Modules/Person/Models/InviteTest.php +++ b/tests/Feature/Integration/Modules/Person/Models/InviteTest.php @@ -5,7 +5,7 @@ use Tests\TestCase; use App\Modules\Person\Models\Invite; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; /** * @group groups @@ -13,7 +13,7 @@ */ class InviteTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; /** * @test diff --git a/tests/Feature/Integration/Modules/User/Actions/CreateUserTest.php b/tests/Feature/Integration/Modules/User/Actions/CreateUserTest.php index 825f8fadd..2da3b6446 100644 --- a/tests/Feature/Integration/Modules/User/Actions/CreateUserTest.php +++ b/tests/Feature/Integration/Modules/User/Actions/CreateUserTest.php @@ -9,11 +9,11 @@ use App\Modules\User\Jobs\CreateUser; use App\Modules\User\Actions\UserCreate; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class CreateUserTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/Integration/Modules/User/Actions/UpdateUserTest.php b/tests/Feature/Integration/Modules/User/Actions/UpdateUserTest.php index bb7ee0c74..a6d1e3c1a 100644 --- a/tests/Feature/Integration/Modules/User/Actions/UpdateUserTest.php +++ b/tests/Feature/Integration/Modules/User/Actions/UpdateUserTest.php @@ -9,11 +9,11 @@ use App\Modules\User\Jobs\UpdateUser; use App\Modules\User\Actions\UserUpdate; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class UpdateUserTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/Integration/Notificaitons/NotifyStepApprovedTest.php b/tests/Feature/Integration/Notificaitons/NotifyStepApprovedTest.php index de903c817..902e3455d 100644 --- a/tests/Feature/Integration/Notificaitons/NotifyStepApprovedTest.php +++ b/tests/Feature/Integration/Notificaitons/NotifyStepApprovedTest.php @@ -12,12 +12,12 @@ use App\Modules\ExpertPanel\Models\ExpertPanel; use App\Modules\ExpertPanel\Actions\StepApprove; use App\Notifications\UserDefinedMailNotification; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\Modules\Application\Notifications\ApplicationStepApprovedNotification; class NotifyStepApprovedTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/Integration/RecordsOutgoingMailTest.php b/tests/Feature/Integration/RecordsOutgoingMailTest.php index 2b375a561..508bfc519 100644 --- a/tests/Feature/Integration/RecordsOutgoingMailTest.php +++ b/tests/Feature/Integration/RecordsOutgoingMailTest.php @@ -8,11 +8,11 @@ use Illuminate\Foundation\Testing\WithFaker; use Illuminate\Support\Facades\Notification; use App\Notifications\UserDefinedMailNotification; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class RecordsOutgoingMailTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; private $person; diff --git a/tests/Feature/Integration/UseDatabaseTransactionsTest.php b/tests/Feature/Integration/UseDatabaseTransactionsTest.php index 53e891713..09b772db0 100644 --- a/tests/Feature/Integration/UseDatabaseTransactionsTest.php +++ b/tests/Feature/Integration/UseDatabaseTransactionsTest.php @@ -9,11 +9,11 @@ use App\Jobs\Pipes\UseDatabaseTransactions; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class UseDatabaseTransactionsTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/IsGroupMemberTest.php b/tests/Feature/IsGroupMemberTest.php index 3bdff7221..6ebf106bf 100644 --- a/tests/Feature/IsGroupMemberTest.php +++ b/tests/Feature/IsGroupMemberTest.php @@ -10,7 +10,7 @@ use App\Modules\Group\Actions\MemberAdd; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\Group\Actions\MemberAssignRole; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\Modules\Group\Actions\MemberGrantPermissions; /** @@ -18,7 +18,7 @@ */ class IsGroupMemberTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/MailContactsTest.php b/tests/Feature/MailContactsTest.php index d60a12ac7..a439cea75 100644 --- a/tests/Feature/MailContactsTest.php +++ b/tests/Feature/MailContactsTest.php @@ -12,12 +12,12 @@ use App\Modules\Group\Actions\ContactsMail; use Illuminate\Foundation\Testing\WithFaker; use App\Modules\Group\Actions\MemberAssignRole; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Tests\Feature\End2End\Groups\Members\SetsUpGroupPersonAndMember; class MailContactsTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; use SetsUpGroupPersonAndMember; private $addMember, $assignRole, $groupMember; diff --git a/tests/Feature/MessagePusherFactoryTest.php b/tests/Feature/MessagePusherFactoryTest.php index a2ccf38a0..57b7d0ea8 100644 --- a/tests/Feature/MessagePusherFactoryTest.php +++ b/tests/Feature/MessagePusherFactoryTest.php @@ -6,7 +6,7 @@ use App\DataExchange\Kafka\KafkaProducer; use Illuminate\Foundation\Testing\WithFaker; use App\DataExchange\MessagePushers\MessageLogger; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\DataExchange\MessagePushers\DisabledPusher; use App\DataExchange\MessagePushers\MessagePusherFactory; diff --git a/tests/Feature/Person/Actions/PermissionAddTest.php b/tests/Feature/Person/Actions/PermissionAddTest.php index 2b98d2d18..5eaaa39b8 100644 --- a/tests/Feature/Person/Actions/PermissionAddTest.php +++ b/tests/Feature/Person/Actions/PermissionAddTest.php @@ -12,11 +12,11 @@ use App\Modules\Person\Actions\PermissionAdd; use App\Modules\Person\Events\InviteRedeemed; use Carbon\Carbon; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class PermissionAddTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/Person/Actions/PermissionRemoveTest.php b/tests/Feature/Person/Actions/PermissionRemoveTest.php index 4ffc6c5ad..fc615a9a8 100644 --- a/tests/Feature/Person/Actions/PermissionRemoveTest.php +++ b/tests/Feature/Person/Actions/PermissionRemoveTest.php @@ -13,11 +13,11 @@ use App\Modules\Person\Actions\PermissionRemove; use App\Modules\Person\Events\InviteRedeemed; use Carbon\Carbon; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class PermissionRemoveTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Feature/PersonLookupsEndpointTest.php b/tests/Feature/PersonLookupsEndpointTest.php index e21b7f4eb..83e0d3e17 100644 --- a/tests/Feature/PersonLookupsEndpointTest.php +++ b/tests/Feature/PersonLookupsEndpointTest.php @@ -10,11 +10,11 @@ use Database\Seeders\GenderSeeder; use Database\Seeders\PrimaryOccupationSeeder; use Illuminate\Foundation\Testing\WithFaker; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class PersonLookupsEndpointTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/TestCase.php b/tests/TestCase.php index fa425fbb6..4c5ac136e 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -17,14 +17,14 @@ use Illuminate\Foundation\Testing\WithFaker; use App\Modules\ExpertPanel\Actions\ContactAdd; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use Illuminate\Foundation\Testing\TestCase as BaseTestCase; abstract class TestCase extends BaseTestCase { use CreatesApplication; use WithFaker; - use RefreshDatabase; + use FastRefreshDatabase; // Helper methods public function setup():void diff --git a/tests/Unit/Actions/DataFixes/ReorderStreamMessagesTest.php b/tests/Unit/Actions/DataFixes/ReorderStreamMessagesTest.php index c472cc963..727fa059b 100644 --- a/tests/Unit/Actions/DataFixes/ReorderStreamMessagesTest.php +++ b/tests/Unit/Actions/DataFixes/ReorderStreamMessagesTest.php @@ -6,11 +6,11 @@ use Tests\TestCase; use Illuminate\Support\Facades\Schema; use App\DataExchange\Models\StreamMessage; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class ReorderStreamMessagesTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; private $tenDaysAgo; diff --git a/tests/Unit/CoiApplyingActiveTest.php b/tests/Unit/CoiApplyingActiveTest.php index c0594ad08..76faeee50 100644 --- a/tests/Unit/CoiApplyingActiveTest.php +++ b/tests/Unit/CoiApplyingActiveTest.php @@ -6,11 +6,11 @@ use App\Modules\Group\Models\Group; use App\Modules\Person\Models\Person; use App\Modules\Group\Models\GroupMember; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class CoiApplyingActiveTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Unit/DX/MessageFactories/DxMessageFactoryTest.php b/tests/Unit/DX/MessageFactories/DxMessageFactoryTest.php index e1a3164d2..d631d3cfc 100644 --- a/tests/Unit/DX/MessageFactories/DxMessageFactoryTest.php +++ b/tests/Unit/DX/MessageFactories/DxMessageFactoryTest.php @@ -23,7 +23,7 @@ use App\Modules\ExpertPanel\Events\StepApproved; use App\Modules\Group\Events\MemberRoleAssigned; use App\Modules\Group\Events\GeneRemovedApproved; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\Modules\Group\Events\MemberPermissionRevoked; use App\Modules\Group\Events\MemberPermissionsGranted; use App\DataExchange\MessageFactories\DxMessageFactory; @@ -33,7 +33,7 @@ */ class DxMessageFactoryTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; private ExpertPanel $expertPanel; private DxMessageFactory $factory; diff --git a/tests/Unit/FollowActionTest.php b/tests/Unit/FollowActionTest.php index a3105177c..c6fbb7e13 100644 --- a/tests/Unit/FollowActionTest.php +++ b/tests/Unit/FollowActionTest.php @@ -6,11 +6,11 @@ use App\Models\FollowAction; use Tests\Dummies\TestEvent; use Tests\Dummies\TestFollower; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class FollowActionTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; /** * @test diff --git a/tests/Unit/Listeners/RecordEventTest.php b/tests/Unit/Listeners/RecordEventTest.php index 429cf2b17..5f1f5700e 100644 --- a/tests/Unit/Listeners/RecordEventTest.php +++ b/tests/Unit/Listeners/RecordEventTest.php @@ -9,11 +9,11 @@ use App\Events\RecordableEvent; use App\Modules\User\Models\User; use Illuminate\Database\Eloquent\Model; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class RecordEventTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; private $event, $listener; diff --git a/tests/Unit/Modules/Service/StepManagerFactoryTest.php b/tests/Unit/Modules/Service/StepManagerFactoryTest.php index 653cbeacf..e4330892d 100644 --- a/tests/Unit/Modules/Service/StepManagerFactoryTest.php +++ b/tests/Unit/Modules/Service/StepManagerFactoryTest.php @@ -5,7 +5,7 @@ use Tests\TestCase; use Illuminate\Support\Carbon; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\Modules\ExpertPanel\Service\StepManagerFactory; use App\Modules\ExpertPanel\Service\Steps\VcepDraftStepManager; use App\Modules\ExpertPanel\Service\Steps\VcepPilotStepManager; @@ -16,7 +16,7 @@ class StepManagerFactoryTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Unit/Notifications/AddedToGroupNotificationTest.php b/tests/Unit/Notifications/AddedToGroupNotificationTest.php index 099262c27..e53661db1 100644 --- a/tests/Unit/Notifications/AddedToGroupNotificationTest.php +++ b/tests/Unit/Notifications/AddedToGroupNotificationTest.php @@ -9,12 +9,12 @@ use App\Modules\Person\Models\Invite; use App\Modules\Person\Models\Person; use App\Modules\ExpertPanel\Models\ExpertPanel; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; use App\Modules\Group\Notifications\AddedToGroupNotification; class AddedToGroupNotificationTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { diff --git a/tests/Unit/PersonTest.php b/tests/Unit/PersonTest.php index 0bde965c4..211487fe5 100644 --- a/tests/Unit/PersonTest.php +++ b/tests/Unit/PersonTest.php @@ -6,11 +6,11 @@ use App\Modules\Group\Models\Group; use App\Modules\Person\Models\Person; use App\Modules\Group\Models\GroupMember; -use Illuminate\Foundation\Testing\RefreshDatabase; +use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; class PersonTest extends TestCase { - use RefreshDatabase; + use FastRefreshDatabase; public function setup():void { From cf552ddf77a37ac909f19238a8863028bcf1304e Mon Sep 17 00:00:00 2001 From: Bradford Powell Date: Mon, 3 Feb 2025 21:30:00 -0500 Subject: [PATCH 20/21] more additions to bubble scope_description up to description --- app/Modules/Group/Events/GroupDescriptionUpdated.php | 4 ++-- app/Modules/Group/Models/Group.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Modules/Group/Events/GroupDescriptionUpdated.php b/app/Modules/Group/Events/GroupDescriptionUpdated.php index 6574b0991..fabbb6451 100644 --- a/app/Modules/Group/Events/GroupDescriptionUpdated.php +++ b/app/Modules/Group/Events/GroupDescriptionUpdated.php @@ -26,12 +26,12 @@ public function __construct(public Group $group, public ?string $description) public function getLogEntry():string { - return 'Scope description updated.'; + return 'Group description updated.'; } public function getProperties():array { - return ['scope_description' => $this->description]; + return ['description' => $this->description]; } /** diff --git a/app/Modules/Group/Models/Group.php b/app/Modules/Group/Models/Group.php index d6bb8e946..a63fe3133 100644 --- a/app/Modules/Group/Models/Group.php +++ b/app/Modules/Group/Models/Group.php @@ -287,6 +287,7 @@ public function representationForDataExchange(): array { 'name' => $this->name, 'status' => $this->groupStatus->name, 'type' => $this->type->name, + 'description' => $this->description, ]; if ($this->parent != null) { $item['parent_group'] = $this->parent->representationForDataExchange(); @@ -294,7 +295,6 @@ public function representationForDataExchange(): array { if ($this->isEp) { $item['ep_id'] = $this->expertPanel->uuid; $item['affiliation_id'] = $this->expertPanel->affiliation_id; - $item['scope_description'] = $this->expertPanel->scope_description; $item['short_name'] = $this->expertPanel->short_base_name; // TODO: not sure about these fields // $item['long_base_name'] = $this->expertPanel->long_base_name; From 719d60d4875f7ff94a53297f774908c753b4c881 Mon Sep 17 00:00:00 2001 From: Bradford Powell Date: Mon, 3 Feb 2025 21:30:43 -0500 Subject: [PATCH 21/21] more test fixes and ScopeDescription renamings --- .../UpdateExpertPanelAttributesTest.php | 15 ++++---- .../Groups/Members/AssignRoleToMemberTest.php | 2 ++ ...est.php => UpdateGroupDescriptionTest.php} | 34 +++++-------------- 3 files changed, 16 insertions(+), 35 deletions(-) rename tests/Feature/End2End/Groups/{UpdateScopeDescriptionTest.php => UpdateGroupDescriptionTest.php} (67%) diff --git a/tests/Feature/End2End/ExpertPanels/UpdateExpertPanelAttributesTest.php b/tests/Feature/End2End/ExpertPanels/UpdateExpertPanelAttributesTest.php index 22f1d5d5a..0766f9db9 100644 --- a/tests/Feature/End2End/ExpertPanels/UpdateExpertPanelAttributesTest.php +++ b/tests/Feature/End2End/ExpertPanels/UpdateExpertPanelAttributesTest.php @@ -194,16 +194,13 @@ public function ep_info_updated_event_published_if_EP_definition_approved() $this->assertDatabaseHas('stream_messages', [ 'topic' => config('dx.topics.outgoing.gpm-general-events'), 'message->event_type' => 'ep_info_updated', - 'message->schema_version' => '1.1.0', + 'message->schema_version' => '1.9.9', 'message->date' => Carbon::now()->format('Y-m-d H:i:s'), - 'message->data->expert_panel->id' => $ep->group->uuid, - 'message->data->expert_panel->name' => $ep->group->display_name, - 'message->data->expert_panel->type' => $ep->group->type->name, - 'message->data->expert_panel->affiliation_id' => $ep->affiliation_id, - 'message->data->expert_panel->long_base_name' => $ep->long_base_name, - 'message->data->expert_panel->short_base_name' => $ep->short_base_name, - 'message->data->expert_panel->hypothesis_group' => $ep->hypothesis_group, - 'message->data->expert_panel->membership_description' => $ep->membership_description, + 'message->data->id' => $ep->group->uuid, + 'message->data->name' => $ep->group->display_name, + 'message->data->type' => $ep->group->type->name, + 'message->data->affiliation_id' => $ep->affiliation_id, + 'message->data->short_name' => $ep->short_base_name, 'message->data->expert_panel->scope_description' => $ep->scope_description ]); } diff --git a/tests/Feature/End2End/Groups/Members/AssignRoleToMemberTest.php b/tests/Feature/End2End/Groups/Members/AssignRoleToMemberTest.php index b87b5b3e2..c061899f1 100644 --- a/tests/Feature/End2End/Groups/Members/AssignRoleToMemberTest.php +++ b/tests/Feature/End2End/Groups/Members/AssignRoleToMemberTest.php @@ -123,6 +123,8 @@ public function logs_member_role_assignment_activity() ] ); + $this->groupMember = $this->groupMember->fresh(); + $this->assertDatabaseHas('activity_log', [ 'subject_type' => Group::class, 'subject_id' => $this->groupMember->group->id, diff --git a/tests/Feature/End2End/Groups/UpdateScopeDescriptionTest.php b/tests/Feature/End2End/Groups/UpdateGroupDescriptionTest.php similarity index 67% rename from tests/Feature/End2End/Groups/UpdateScopeDescriptionTest.php rename to tests/Feature/End2End/Groups/UpdateGroupDescriptionTest.php index 172f6428f..dd9c259cd 100644 --- a/tests/Feature/End2End/Groups/UpdateScopeDescriptionTest.php +++ b/tests/Feature/End2End/Groups/UpdateGroupDescriptionTest.php @@ -10,7 +10,7 @@ use App\Modules\ExpertPanel\Models\ExpertPanel; use Plannr\Laravel\FastRefreshDatabase\Traits\FastRefreshDatabase; -class UpdateScopeDescriptionTest extends TestCase +class UpdateGroupDescriptionTest extends TestCase { use FastRefreshDatabase; @@ -30,7 +30,7 @@ public function unprivileged_users_cannot_save_scope_description() { $unprivileged = User::factory()->create(); Sanctum::actingAs($unprivileged); - $this->json('PUT', $this->url, ['scope_description' => 'this is a scope description']) + $this->json('PUT', $this->url, ['description' => 'this is a scope description']) ->assertStatus(403); } @@ -43,7 +43,7 @@ public function validates_input() $this->json('PUT', $this->url, []) ->assertStatus(422) ->assertJsonFragment([ - 'scope_description' => ['This field is required.'] + 'description' => ['This field is required.'] ]); } @@ -54,7 +54,7 @@ public function privileged_user_can_store_scope_description() { Sanctum::actingAs($this->user); $description = 'I am a description of the scope. I can be greater than 255 characters.I am a description of the scope. I can be greater than 255 characters.I am a description of the scope. I can be greater than 255 characters.I am a description of the scope. I can be greater than 255 characters.'; - $response = $this->json('PUT', $this->url, ['scope_description' => $description]); + $response = $this->json('PUT', $this->url, ['description' => $description]); $response->assertStatus(200); $response->assertJsonFragment([ 'uuid' => $this->expertPanel->group->uuid @@ -74,35 +74,17 @@ public function logs_activity() { $description = 'Test description'; Sanctum::actingAs($this->user); - $response = $this->json('PUT', $this->url, ['scope_description' => $description]); + $response = $this->json('PUT', $this->url, ['description' => $description]); $response->assertStatus(200); $this->assertDatabaseHas('activity_log', [ 'subject_type' => Group::class, 'subject_id' => $this->expertPanel->group_id, - 'activity_type' => 'scope-description-updated', - 'description' => 'Scope description updated.', - 'properties->scope_description' => $description, + 'activity_type' => 'group-description-updated', + 'description' => 'Group description updated.', + 'properties->description' => $description, ]); } - /** - * @test - */ - public function throws_validation_error_if_group_is_not_an_expert_panel() - { - $this->expertPanel->group->update(['group_type_id' => config('groups.types.wg.id')]); - - // dd($this->expertPanel->group->toArray()); - - Sanctum::actingAs($this->user); - $response = $this->json('PUT', $this->url, ['scope_description' => 'test test test']); - - $response->assertStatus(422); - - $response->assertJsonFragment([ - 'scope_description' => ['A description of scope can only be set for expert panels.'] - ]); - } }