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
10 changes: 9 additions & 1 deletion .github/workflows/backend-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
composer run-script check-cs -- --format=checkstyle | cs2pr

tests:
name: Unit tests & SQLite integration tests
name: Unit tests & SQLite integration tests (${{ matrix.php }}${{ !matrix.schema_builder_event && ', Doctrine Migrations' || '' }})
runs-on: "ubuntu-26.04"
timeout-minutes: 15

Expand All @@ -42,6 +42,12 @@ jobs:
matrix:
php:
- '8.5'
schema_builder_event:
- true
# One more run, on the Doctrine Migrations install path.
include:
- php: '8.5'
schema_builder_event: false

steps:
- uses: actions/checkout@v7
Expand All @@ -62,3 +68,5 @@ jobs:

- name: Run test suite
run: composer run-script --timeout=600 test
env:
IBEXA_TEST_SCHEMA_BUILDER_EVENT_ENABLED: ${{ matrix.schema_builder_event && '1' || '0' }}
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"twig/twig": "^3.0"
},
"require-dev": {
"doctrine/doctrine-migrations-bundle": "^3.2",
"ibexa/code-style": "~2.3.1",
"ibexa/design-engine": "~6.0.x-dev",
"ibexa/doctrine-schema": "~6.0.x-dev",
Expand Down
13 changes: 12 additions & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,21 @@
*/
declare(strict_types=1);

use Ibexa\Contracts\Test\Core\Bootstrapper\BaseFixtureHook;
use Ibexa\Contracts\Test\Core\Bootstrapper\Bootstrapper;
use Ibexa\Contracts\Test\Core\Bootstrapper\SchemaInstallPath;

require dirname(__DIR__) . '/vendor/autoload.php';

chdir(__DIR__ . '/..');

(new Bootstrapper())->bootstrap();
// Selects which of the two coexisting schema install paths this run exercises: the
// SchemaBuilderEvent one by default, or the Doctrine Migrations one with
// IBEXA_TEST_SCHEMA_BUILDER_EVENT_ENABLED=0.
$doctrineMigrationsEnabled = getenv('IBEXA_TEST_SCHEMA_BUILDER_EVENT_ENABLED') === '0';

(new Bootstrapper())->bootstrap(null, SchemaInstallPath::getBootstrapperOptions($doctrineMigrationsEnabled) + [
// On the Doctrine Migrations path, ibexa/core's ImportDataMigration has already inserted the
// baseline repository content.
BaseFixtureHook::class => [BaseFixtureHook::OPTION_LOAD_BASE_FIXTURE => !$doctrineMigrationsEnabled],
]);
4 changes: 3 additions & 1 deletion tests/bundle/Command/UpdateUserCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,12 @@ public function testExecuteWithEnableAndDisableOptionsReturnsFailure(): void

public function testExecuteReturnsSuccess(): void
{
// `--password` without a value, so the command asks for it
$this->commandTester->setInputs(['Ibexa-Password1']);
$this->commandTester->execute(
[
'user' => 'anonymous',
'--password' => true,
'--password' => null,
'--email' => 'foo@bar.com',
'--enable' => true,
],
Expand Down
6 changes: 6 additions & 0 deletions tests/integration/IbexaTestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

namespace Ibexa\Tests\Integration\User;

use Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle;
use Ibexa\Bundle\ContentForms\IbexaContentFormsBundle;
use Ibexa\Bundle\DoctrineMigrations\IbexaDoctrineMigrationsBundle;
use Ibexa\Bundle\Notifications\IbexaNotificationsBundle;
use Ibexa\Bundle\Test\Core\IbexaTestCoreBundle;
use Ibexa\Bundle\User\IbexaUserBundle;
Expand All @@ -30,6 +32,10 @@ public function registerBundles(): iterable

yield new IbexaTestCoreBundle();

yield new DoctrineMigrationsBundle();

yield new IbexaDoctrineMigrationsBundle();

yield from [
new IbexaUserBundle(),
new IbexaNotificationsBundle(),
Expand Down
15 changes: 15 additions & 0 deletions tests/integration/SchemaAlignmentTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace Ibexa\Tests\Integration\User;

use Ibexa\Contracts\Test\Core\Schema\AbstractSchemaAlignmentTestCase;
use PHPUnit\Framework\Attributes\CoversNothing;

#[CoversNothing]
final class SchemaAlignmentTest extends AbstractSchemaAlignmentTestCase {}
Loading