Skip to content

Commit

Permalink
Updating eventSubscriber to use fileInterface.
Browse files Browse the repository at this point in the history
  • Loading branch information
apathak18 committed Aug 2, 2024
1 parent cda2b77 commit dd9a986
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ type: module
name: GraphQL File Validate Test
description: Tests file validate on uploads.
package: Testing
hidden: TRUE
hidden: TRUE
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use Drupal\file\FileInterface;
/**
* Test to validate file exists.
*/
function graphql_file_validate(FileInterface $file): void {
function graphql_file_validate_test_file(FileInterface $file): void {
if (!file_exists($file->getFileUri())) {
throw new \Exception('File does not exist during validation: ' . $file->getFileUri());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class GraphqlFileValidationTestSubscriber implements EventSubscriberInterface {
* The event.
*/
public function onFileValidation(FileValidationEvent $event): void {
graphql_file_validate('validate', [$event->file->id()]);
graphql_file_validate_test_file($event->file);
}

/**
Expand Down

0 comments on commit dd9a986

Please sign in to comment.