mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2024-11-24 16:56:12 +01:00

[TASK] Update reference index after changing test data

Related #1120
This commit is contained in:
Karsten Nowak 2024-07-30 12:32:54 +02:00
parent 91e2a2d16f
commit 1430186268

View file

@ -4,13 +4,19 @@ declare(strict_types=1);
namespace TTN\Tea\Command;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use TYPO3\CMS\Backend\Command\ProgressListener\ReferenceIndexProgressListener;
use TYPO3\CMS\Backend\Command\ReferenceIndexUpdateCommand;
use TYPO3\CMS\Core\Core\Bootstrap;
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Database\ReferenceIndex;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/*
@ -76,6 +82,10 @@ final class CreateTestDataCommand extends Command
}
$output->writeln(sprintf('Test data in page %s created.', $pageUid));
$referenceIndex = GeneralUtility::makeInstance(ReferenceIndex::class);
$referenceIndex->updateIndex(0);
$output->writeln('Reference index updated.');
return Command::SUCCESS;
}
}