diff --git a/app/Http/Controllers/EntityController.php b/app/Http/Controllers/EntityController.php index 17e28a5..f4ef207 100644 --- a/app/Http/Controllers/EntityController.php +++ b/app/Http/Controllers/EntityController.php @@ -335,16 +335,16 @@ function () use ($entity) { ])->dispatch();*/ // TODO here M:N connection wit federation - foreach ($entity->federations as $federation) { -/* Bus::chain([ +/* foreach ($entity->federations as $federation) { + Bus::chain([ new GitAddMember($federation, $entity, Auth::user()), function () use ($federation, $entity) { $admins = User::activeAdmins()->select('id', 'email')->get(); Notification::send($federation->operators, new FederationMemberChanged($federation, $entity, 'added')); Notification::send($admins, new FederationMemberChanged($federation, $entity, 'added')); }, - ])->dispatch();*/ - } + ])->dispatch(); + }*/ } else { $entity->delete(); @@ -435,7 +435,8 @@ function () use ($entity) { $status = $entity->edugain ? 'edugain' : 'no_edugain'; $color = $entity->edugain ? 'green' : 'red'; - if ($entity->edugain) { + // TODO add and delete from EDUGAIN +/* if ($entity->edugain) { Bus::chain([ new GitAddToEdugain($entity, Auth::user()), function () use ($entity) { @@ -453,7 +454,7 @@ function () use ($entity) { Notification::send($admins, new EntityEdugainStatusChanged($entity)); }, ])->dispatch(); - } + }*/ return redirect() ->back() @@ -509,14 +510,15 @@ function () use ($entity) { $entity->category()->associate($category); $entity->save(); - Bus::chain([ + // TODO work with category +/* Bus::chain([ new GitDeleteFromCategory($old_category, $entity, Auth::user()), new GitAddToCategory($category, $entity, Auth::user()), function () use ($entity, $category) { $admins = User::activeAdmins()->select('id', 'email')->get(); Notification::send($admins, new IdpCategoryChanged($entity, $category)); }, - ])->dispatch(); + ])->dispatch();*/ if (! $entity->wasChanged()) { return redirect() diff --git a/tests/Feature/Http/Controllers/EntityControllerTest.php b/tests/Feature/Http/Controllers/EntityControllerTest.php index 3e5eb87..9be8195 100644 --- a/tests/Feature/Http/Controllers/EntityControllerTest.php +++ b/tests/Feature/Http/Controllers/EntityControllerTest.php @@ -292,9 +292,9 @@ public function a_user_can_add_a_new_entity() $whoami = ' - + - + @@ -309,7 +309,7 @@ public function a_user_can_add_a_new_entity() - + cesnet.cz @@ -323,7 +323,7 @@ public function a_user_can_add_a_new_entity() https://whoami.cesnet.cz/idp/images/cesnet-logo-40.png - + @@ -382,19 +382,19 @@ public function a_user_can_add_a_new_entity() - + - + - + - + CESNET, a. l. e. CESNET, z. s. p. o. @@ -403,7 +403,7 @@ public function a_user_can_add_a_new_entity() https://www.ces.net/ https://www.cesnet.cz/ - + Jan Oppolzer @@ -423,7 +423,7 @@ public function a_user_can_add_a_new_entity() CESNET-CERTS mailto:abuse@cesnet.cz - + '; // add an entity using wrong metadata content @@ -496,9 +496,9 @@ public function a_user_with_operator_permission_can_edit_an_existing_entity() $whoami = ' - + - + @@ -513,7 +513,7 @@ public function a_user_with_operator_permission_can_edit_an_existing_entity() - + cesnet.cz @@ -527,7 +527,7 @@ public function a_user_with_operator_permission_can_edit_an_existing_entity() https://whoami.cesnet.cz/idp/images/cesnet-logo-40.png - + @@ -586,19 +586,19 @@ public function a_user_with_operator_permission_can_edit_an_existing_entity() - + - + - + - + CESNET, a. l. e. CESNET, z. s. p. o. @@ -607,7 +607,7 @@ public function a_user_with_operator_permission_can_edit_an_existing_entity() https://www.ces.net/ https://www.cesnet.cz/ - + Jan Oppolzer @@ -627,7 +627,7 @@ public function a_user_with_operator_permission_can_edit_an_existing_entity() CESNET-CERTS mailto:abuse@cesnet.cz - + '; $this @@ -641,9 +641,9 @@ public function a_user_with_operator_permission_can_edit_an_existing_entity() $this->assertEquals(route('entities.show', $entity), url()->current()); - Bus::assertDispatched(GitUpdateEntity::class, function ($job) use ($entity) { +/* Bus::assertDispatched(GitUpdateEntity::class, function ($job) use ($entity) { return $job->entity->is($entity); - }); + });*/ } /** @test */ @@ -664,9 +664,9 @@ public function a_user_with_operator_permission_can_change_an_existing_entities_ ->patch(route('entities.update', $entity), ['action' => 'state']) ->assertSeeText(__('entities.deleted', ['name' => $entity->name_en])); - Bus::assertDispatched(GitDeleteEntity::class, function ($job) use ($entity) { +/* Bus::assertDispatched(GitDeleteEntity::class, function ($job) use ($entity) { return $job->entity->is($entity); - }); + });*/ $entity->refresh(); $this->assertTrue($entity->trashed()); @@ -682,9 +682,9 @@ public function a_user_with_operator_permission_can_change_an_existing_entities_ $this->assertFalse($entity->trashed()); $this->assertEquals(route('entities.show', $entity), url()->current()); - Bus::assertDispatched(GitAddEntity::class, function ($job) use ($entity) { +/* Bus::assertDispatched(GitAddEntity::class, function ($job) use ($entity) { return $job->entity->is($entity); - }); + });*/ } /** @test */ @@ -949,9 +949,9 @@ public function an_admin_can_add_a_new_entity() $whoami = ' - + - + @@ -966,7 +966,7 @@ public function an_admin_can_add_a_new_entity() - + cesnet.cz @@ -980,7 +980,7 @@ public function an_admin_can_add_a_new_entity() https://whoami.cesnet.cz/idp/images/cesnet-logo-40.png - + @@ -1039,19 +1039,19 @@ public function an_admin_can_add_a_new_entity() - + - + - + - + CESNET, a. l. e. CESNET, z. s. p. o. @@ -1060,7 +1060,7 @@ public function an_admin_can_add_a_new_entity() https://www.ces.net/ https://www.cesnet.cz/ - + Jan Oppolzer @@ -1080,7 +1080,7 @@ public function an_admin_can_add_a_new_entity() CESNET-CERTS mailto:abuse@cesnet.cz - + '; // add an entity using wrong metadata content @@ -1140,9 +1140,9 @@ public function an_admin_can_edit_an_existing_entity() $whoami = ' - + - + @@ -1157,7 +1157,7 @@ public function an_admin_can_edit_an_existing_entity() - + cesnet.cz @@ -1171,7 +1171,7 @@ public function an_admin_can_edit_an_existing_entity() https://whoami.cesnet.cz/idp/images/cesnet-logo-40.png - + @@ -1230,19 +1230,19 @@ public function an_admin_can_edit_an_existing_entity() - + - + - + - + CESNET, a. l. e. CESNET, z. s. p. o. @@ -1251,7 +1251,7 @@ public function an_admin_can_edit_an_existing_entity() https://www.ces.net/ https://www.cesnet.cz/ - + Jan Oppolzer @@ -1271,7 +1271,7 @@ public function an_admin_can_edit_an_existing_entity() CESNET-CERTS mailto:abuse@cesnet.cz - + '; $this @@ -1284,9 +1284,9 @@ public function an_admin_can_edit_an_existing_entity() ->assertSeeText(__('entities.entity_updated')); $this->assertEquals(route('entities.show', $entity), url()->current()); - Bus::assertDispatched(GitUpdateEntity::class, function ($job) use ($entity) { +/* Bus::assertDispatched(GitUpdateEntity::class, function ($job) use ($entity) { return $job->entity->is($entity); - }); + });*/ } /** @test */ @@ -1306,9 +1306,9 @@ public function an_admin_can_change_an_existing_entities_state() ->patch(route('entities.update', $entity), ['action' => 'state']) ->assertSeeText(__('entities.deleted', ['name' => $entity->name_en])); - Bus::assertDispatched(GitDeleteEntity::class, function ($job) use ($entity) { +/* Bus::assertDispatched(GitDeleteEntity::class, function ($job) use ($entity) { return $job->entity->is($entity); - }); + });*/ $entity->refresh(); $this->assertTrue($entity->trashed()); @@ -1324,9 +1324,9 @@ public function an_admin_can_change_an_existing_entities_state() $this->assertFalse($entity->trashed()); $this->assertEquals(route('entities.show', $entity), url()->current()); - Bus::assertDispatched(GitAddEntity::class, function ($job) use ($entity) { +/* Bus::assertDispatched(GitAddEntity::class, function ($job) use ($entity) { return $job->entity->is($entity); - }); + });*/ } /** @test */