Skip to content

Commit

Permalink
Merged branch '4.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
alongosz committed Mar 19, 2024
2 parents 2058a8a + 95c444c commit 47b895a
Show file tree
Hide file tree
Showing 10 changed files with 193 additions and 4 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,40 @@ jobs:

- name: Run test suite
run: composer run-script --timeout=600 test

integration-tests:
name: Integration yests
needs: tests
runs-on: "ubuntu-20.04"
timeout-minutes: 10

strategy:
fail-fast: false
matrix:
php:
- '7.4'
- '8.0'
- '8.1'
composer_options: [ "" ]

steps:
- uses: actions/checkout@v2

- name: Setup PHP Action
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
extensions: pdo_sqlite, gd
tools: cs2pr

- uses: "ramsey/composer-install@v1"
with:
dependency-versions: "highest"
composer-options: "--prefer-dist --no-progress --no-suggest ${{ matrix.composer_options }}"

- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Run test suite
run: composer run-script --timeout=600 test-integration
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
"ibexa/fieldtype-richtext": "~5.0.0@dev",
"ibexa/rest": "~5.0.0@dev",
"ibexa/search": "~5.0.0@dev",
"ibexa/test-core": "~5.0.x-dev",
"ibexa/http-cache": "~5.0.0@dev",
"ibexa/notifications": "~5.0.x-dev",
"phpunit/phpunit": "^8.2",
"matthiasnoback/symfony-dependency-injection-test": "^4.0"
},
Expand All @@ -40,6 +42,7 @@
"autoload-dev": {
"psr-4": {
"Ibexa\\Tests\\SystemInfo\\": "tests/lib/",
"Ibexa\\Tests\\Integration\\SystemInfo\\": "tests/integration/",
"Ibexa\\Tests\\Bundle\\SystemInfo\\": "tests/bundle/"
}
},
Expand All @@ -51,7 +54,8 @@
"scripts": {
"fix-cs": "php-cs-fixer fix --config=.php-cs-fixer.php -v --show-progress=dots",
"check-cs": "@fix-cs --dry-run",
"test": "phpunit -c phpunit.xml"
"test": "phpunit -c phpunit.xml",
"test-integration": "phpunit -c phpunit.integration.xml"
},
"config": {
"allow-plugins": false
Expand Down
15 changes: 15 additions & 0 deletions phpunit.integration.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="tests/bootstrap.php"
failOnWarning="true"
colors="true">
<php>
<env name="KERNEL_CLASS" value="Ibexa\Tests\Integration\SystemInfo\Kernel" />
</php>
<testsuites>
<testsuite name="integration">
<directory>tests/integration</directory>
</testsuite>
</testsuites>
</phpunit>
1 change: 0 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@
</exclude>
</whitelist>
</filter>

</phpunit>
6 changes: 4 additions & 2 deletions src/bundle/SystemInfo/Collector/IbexaSystemInfoCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@ class IbexaSystemInfoCollector implements SystemInfoCollector
'3.0' => '2020-07-10T23:59:59+00:00',
'3.1' => '2020-11-30T23:59:59+00:00',
'3.2' => '2021-02-28T23:59:59+00:00',
'3.3' => '2024-01-31T23:59:59+00:00',
'3.3' => '2024-06-30T23:59:59+00:00',
'4.2' => '2022-11-30T23:59:59+00:00',
'4.3' => '2023-02-28T23:59:59+00:00',
'4.4' => '2023-05-31T23:59:59+00:00',
'4.5' => '2024-03-31T23:59:59+00:00',
];

/**
Expand All @@ -80,10 +81,11 @@ class IbexaSystemInfoCollector implements SystemInfoCollector
'3.0' => '2020-08-31T23:59:59+00:00',
'3.1' => '2021-01-30T23:59:59+00:00',
'3.2' => '2021-04-30T23:59:59+00:00',
'3.3' => '2026-01-31T23:59:59+00:00',
'3.3' => '2026-06-30T23:59:59+00:00',
'4.2' => '2022-12-31T23:59:59+00:00',
'4.3' => '2023-03-31T23:59:59+00:00',
'4.4' => '2023-06-30T23:59:59+00:00',
'4.5' => '2024-04-30T23:59:59+00:00',
];

/**
Expand Down
22 changes: 22 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?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);

use Ibexa\Tests\Integration\SystemInfo\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;

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

chdir(dirname(__DIR__));

$kernel = new Kernel('test', true);
$kernel->boot();

$application = new Application($kernel);
$application->setAutoExit(false);

$kernel->shutdown();
66 changes: 66 additions & 0 deletions tests/integration/Kernel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?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\SystemInfo;

use Hautelook\TemplatedUriBundle\HautelookTemplatedUriBundle;
use Ibexa\Bundle\AdminUi\IbexaAdminUiBundle;
use Ibexa\Bundle\ContentForms\IbexaContentFormsBundle;
use Ibexa\Bundle\DesignEngine\IbexaDesignEngineBundle;
use Ibexa\Bundle\Notifications\IbexaNotificationsBundle;
use Ibexa\Bundle\Rest\IbexaRestBundle;
use Ibexa\Bundle\Search\IbexaSearchBundle;
use Ibexa\Bundle\SystemInfo\IbexaSystemInfoBundle;
use Ibexa\Bundle\User\IbexaUserBundle;
use Ibexa\Contracts\Test\Core\IbexaTestKernel;
use Knp\Bundle\MenuBundle\KnpMenuBundle;
use Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle;
use Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\Config\Resource\FileResource;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\WebpackEncoreBundle\WebpackEncoreBundle;

final class Kernel extends IbexaTestKernel
{
public function registerBundles(): iterable
{
yield from parent::registerBundles();

yield new LexikJWTAuthenticationBundle();
yield new HautelookTemplatedUriBundle();
yield new WebpackEncoreBundle();
yield new SwiftmailerBundle();
yield new KnpMenuBundle();

yield new IbexaRestBundle();
yield new IbexaContentFormsBundle();
yield new IbexaSearchBundle();
yield new IbexaUserBundle();
yield new IbexaDesignEngineBundle();
yield new IbexaAdminUiBundle();
yield new IbexaNotificationsBundle();
yield new IbexaSystemInfoBundle();
}

public function registerContainerConfiguration(LoaderInterface $loader): void
{
parent::registerContainerConfiguration($loader);

$loader->load(__DIR__ . '/Resources/config.yaml');
$loader->load(static function (ContainerBuilder $container): void {
$resource = new FileResource(__DIR__ . '/Resources/routing.yaml');
$container->addResource($resource);
$container->loadFromExtension('framework', [
'router' => [
'resource' => $resource->getResource(),
],
]);
});
}
}
23 changes: 23 additions & 0 deletions tests/integration/Resources/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
parameters:
locale_fallback: en

webpack_encore:
# The path where Encore is building the assets - i.e. Encore.setOutputPath()
output_path: '%kernel.project_dir%/public/build'

lexik_jwt_authentication:
secret_key: 'foo'

ibexa:
repositories:
default:
search:
engine: '%env(SEARCH_ENGINE)%'
connection: default

system:
default:
languages:
- eng-US
- eng-GB
- ger-DE
2 changes: 2 additions & 0 deletions tests/integration/Resources/routing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ibexa.user.default_profile_image.initials:
path: /user/default_profile_image/initials.svg
19 changes: 19 additions & 0 deletions tests/integration/TranslationTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?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\SystemInfo;

use Ibexa\Contracts\Test\Core\Translation\AbstractTranslationCase;

final class TranslationTest extends AbstractTranslationCase
{
public static function provideConfigNamesForTranslation(): iterable
{
yield ['ibexa_system_info'];
}
}

0 comments on commit 47b895a

Please sign in to comment.