Skip to content

Commit

Permalink
OXDEV-805 Revert the event returned on subscriber handler
Browse files Browse the repository at this point in the history
  • Loading branch information
RahatHameed committed Oct 9, 2024
1 parent e941436 commit a196115
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
4 changes: 1 addition & 3 deletions src/UserData/Event/UserDataExportCleanupSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@ public static function getSubscribedEvents(): array
];
}

public function onUserDataExportCleanup(UserDataExportCleanupEventInterface&Event $event): Event
public function onUserDataExportCleanup(UserDataExportCleanupEventInterface&Event $event): void
{
$filePath = $event->getFilePath();

if (file_exists($filePath)) {
unlink($filePath);
}

return $event;
}
}
12 changes: 0 additions & 12 deletions tests/Unit/UserData/Event/UserDataExportCleanupSubscriberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use OxidEsales\GdprOptinModule\UserData\Event\UserDataExportCleanupSubscriber;
use OxidEsales\GdprOptinModule\UserData\Event\UserDataExportCleanupEvent;
use PHPUnit\Framework\TestCase;
use Symfony\Contracts\EventDispatcher\Event;

class UserDataExportCleanupSubscriberTest extends TestCase
{
Expand Down Expand Up @@ -41,17 +40,6 @@ public function testOnUserDataExportCleanupUnlinkedFile(): void
$this->assertFalse(file_exists($testFilePath));
}

public function testOnUserDataExportCleanupReturnsEvent(): void
{
$userDataExportCleanupEventSpy = $this->createStub(UserDataExportCleanupEvent::class);

$sut = new UserDataExportCleanupSubscriber();

$handlerResult = $sut->onUserDataExportCleanup(event: $userDataExportCleanupEventSpy);

$this->assertInstanceOf(Event::class, $handlerResult);
}

public function testSubscriberSubscribesToCorrectEvent(): void
{
$this->assertArrayHasKey(
Expand Down

0 comments on commit a196115

Please sign in to comment.