Available events:
LiipTestFixturesEvents::PRE_FIXTURE_BACKUP_RESTORE
: triggered before restoring the backupLiipTestFixturesEvents::POST_FIXTURE_BACKUP_RESTORE
: triggered after the backup has been restoredLiipTestFixturesEvents::POST_FIXTURE_SETUP
: triggered before purging the databaseLiipTestFixturesEvents::PRE_REFERENCE_SAVE
: triggered before saving the backup of fixturesLiipTestFixturesEvents::POST_REFERENCE_SAVE
: triggered before the backup of fixtures has been saved
<?php
declare(strict_types=1);
namespace Liip\Acme\Tests\AppConfigEvents\EventListener;
use Liip\TestFixturesBundle\Event\PreFixtureBackupRestoreEvent;
use Liip\TestFixturesBundle\LiipTestFixturesEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class FixturesSubscriber implements EventSubscriberInterface
{
public static function getSubscribedEvents(): array
{
return [
LiipTestFixturesEvents::PRE_FIXTURE_BACKUP_RESTORE => 'preFixtureBackupRestore',
];
}
public function preFixtureBackupRestore(PreFixtureBackupRestoreEvent $preFixtureBackupRestoreEvent): void
{
$manager = $preFixtureBackupRestoreEvent->getManager();
$repository = $preFixtureBackupRestoreEvent->getRepository();
$backupFilePath = $preFixtureBackupRestoreEvent->getBackupFilePath();
// your code
}
}
services:
'Liip\Acme\Tests\AppConfigEvents\EventListener\FixturesSubscriber':
tags:
- { name: kernel.event_subscriber }