Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
"ibexa/code-style": "^1.3.x-dev",
"ibexa/notifications": "~4.6.0@dev",
"ibexa/phpstan": "~4.6.x-dev",
"ibexa/test-rest": "^0.1.x-dev",
"ibexa/test-core": "^0.1.x-dev",
"ibexa/test-rest": "~4.6.x-dev",
"ibexa/test-core": "~4.6.x-dev",
"phpstan/phpstan": "^2.0",
"phpstan/phpstan-phpunit": "^2.0",
"phpstan/phpstan-symfony": "^2.0"
Expand Down
4 changes: 4 additions & 0 deletions tests/integration/AdminUiIbexaTestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -43,6 +44,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();
Expand Down
47 changes: 8 additions & 39 deletions tests/integration/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
],
]);
Loading