Skip to content

Commit

Permalink
fix test and run pint
Browse files Browse the repository at this point in the history
  • Loading branch information
temaotl committed Jul 16, 2024
1 parent 50c6fd7 commit c3fbdc7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/Jobs/EduGainAddEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
class EduGainAddEntity implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
use HandlesJobsFailuresTrait,EdugainTrait;
use EdugainTrait,HandlesJobsFailuresTrait;

public Entity $entity;

Expand Down
5 changes: 2 additions & 3 deletions app/Jobs/EduGainDeleteEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class EduGainDeleteEntity implements ShouldQueue
/**
* trait with failure function
*/
use HandlesJobsFailuresTrait,EdugainTrait;
use EdugainTrait,HandlesJobsFailuresTrait;

public Entity $entity;

Expand All @@ -44,7 +44,7 @@ public function handle(): void
$folderName = config('storageCfg.edu2edugain');

if (! Storage::disk($diskName)->exists($folderName)) {
$this->makeEdu2Edugain();
$this->makeEdu2Edugain();
}

try {
Expand All @@ -61,7 +61,6 @@ public function handle(): void
$lock->block(61);
EntityFacade::deleteEntityMetadataFromFolder($this->entity->file, $folderName);


EduGainRunMdaScript::dispatch($lock->owner());
} catch (Exception $e) {
Log::error($e->getMessage());
Expand Down
4 changes: 1 addition & 3 deletions app/Listeners/SendDeletedEntityToDeleteJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@ public function handle(DeleteEntity $event): void
{
$entity = $event->entity;

if(!$entity->isForceDeleting())
{
if (! $entity->isForceDeleting()) {
FolderDeleteEntity::dispatch($event->entity);

if ($event->entity->edugain == 1) {
EduGainDeleteEntity::dispatch($event->entity);
}
}


}
}
3 changes: 0 additions & 3 deletions tests/Feature/Http/Controllers/EntityControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Tests\Feature\Http\Controllers;

use App\Jobs\FolderDeleteEntity;
use App\Models\Entity;
use App\Models\Federation;
use App\Models\Membership;
Expand Down Expand Up @@ -1474,7 +1473,6 @@ public function an_admin_can_purge_an_existing_entity()
->delete(route('entities.destroy', $entity))
->assertSeeText(__('entities.destroyed', ['name' => $name]));

Queue::assertPushed(FolderDeleteEntity::class);
}

/** @test */
Expand All @@ -1496,7 +1494,6 @@ public function an_admin_can_reject_a_new_entity_request()
->delete(route('memberships.destroy', $membership))
->assertSeeText(__('federations.membership_rejected', ['entity' => $entity->name_en]));

Queue::assertPushed(FolderDeleteEntity::class);
}

/** @test */
Expand Down

0 comments on commit c3fbdc7

Please sign in to comment.