diff --git a/tests/integration/AdminUiIbexaTestKernel.php b/tests/integration/AdminUiIbexaTestKernel.php index 9dba54a79b..5e98ebeee4 100644 --- a/tests/integration/AdminUiIbexaTestKernel.php +++ b/tests/integration/AdminUiIbexaTestKernel.php @@ -17,6 +17,7 @@ use Ibexa\Bundle\Notifications\IbexaNotificationsBundle; use Ibexa\Bundle\Rest\IbexaRestBundle; use Ibexa\Bundle\Search\IbexaSearchBundle; +use Ibexa\Bundle\Test\Core\IbexaTestCoreBundle; use Ibexa\Bundle\Test\Rest\IbexaTestRestBundle; use Ibexa\Bundle\TwigComponents\IbexaTwigComponentsBundle; use Ibexa\Bundle\User\IbexaUserBundle; @@ -42,6 +43,9 @@ public function registerBundles(): iterable { yield from parent::registerBundles(); + // required by Bootstrapper: provides HooksExecutorInterface and the built-in hooks + yield new IbexaTestCoreBundle(); + yield new HautelookTemplatedUriBundle(); yield new KnpMenuBundle(); yield new WebpackEncoreBundle(); diff --git a/tests/integration/bootstrap.php b/tests/integration/bootstrap.php index fa6083c9d0..48b6f8c444 100644 --- a/tests/integration/bootstrap.php +++ b/tests/integration/bootstrap.php @@ -6,48 +6,17 @@ */ declare(strict_types=1); -use Ibexa\Contracts\Core\Test\Persistence\Fixture\FixtureImporter; -use Ibexa\Tests\Core\Repository\LegacySchemaImporter; -use Ibexa\Tests\Integration\AdminUi\AdminUiIbexaTestKernel; -use Symfony\Bundle\FrameworkBundle\Console\Application; -use Symfony\Component\Console\Input\ArrayInput; +use Ibexa\Contracts\Test\Core\Bootstrapper\Bootstrapper; $packageRoot = dirname(__DIR__, 2); require_once $packageRoot . '/vendor/autoload.php'; chdir($packageRoot); -$kernel = new AdminUiIbexaTestKernel('test', true); -$kernel->boot(); - -$application = new Application($kernel); -$application->setAutoExit(false); - -$databaseUrl = getenv('DATABASE_URL'); -if ($databaseUrl !== false && 'sqlite' !== substr($databaseUrl, 0, 6)) { - $application->run(new ArrayInput([ - 'command' => 'doctrine:database:drop', - '--if-exists' => '1', - '--force' => '1', - '--quiet' => true, - ])); -} - -$application->run(new ArrayInput([ - 'command' => 'doctrine:database:create', - '--quiet' => true, -])); - -/** @var \Psr\Container\ContainerInterface $testContainer */ -$testContainer = $kernel->getContainer()->get('test.service_container'); - -$schemaImporter = $testContainer->get(LegacySchemaImporter::class); -foreach ($kernel->getSchemaFiles() as $file) { - $schemaImporter->importSchema($file); -} - -$fixtureImporter = $testContainer->get(FixtureImporter::class); -foreach ($kernel->getFixtures() as $fixture) { - $fixtureImporter->import($fixture); -} -$kernel->shutdown(); +(new Bootstrapper())->bootstrap(null, [ + Bootstrapper::class => [ + // this package's tests never ran doctrine:schema:update, and Bootstrapper enables it by + // default; keep it off so the bootstrap stays equivalent + Bootstrapper::OPTION_SCHEMA_UPDATE => false, + ], +]);