-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f6b11f7
commit 5b421ba
Showing
19 changed files
with
309 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,9 @@ | |
"repository": "[email protected]:ibexa/admin-ui.git", | ||
"private": true, | ||
"prettier": "eslint-config-ibexa/prettier", | ||
"dependencies": {}, | ||
"dependencies": { | ||
"prettier": "^3.0.3" | ||
}, | ||
"devDependencies": { | ||
"eslint-config-ibexa": "https://github.com/ibexa/eslint-config-ibexa.git#v1.0.0" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<phpunit | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" | ||
backupGlobals="false" | ||
backupStaticAttributes="false" | ||
bootstrap="tests/integration/bootstrap.php" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
failOnWarning="true" | ||
colors="true"> | ||
<testsuites> | ||
<testsuite name="integration"> | ||
<directory>tests/integration</directory> | ||
</testsuite> | ||
</testsuites> | ||
<php> | ||
<env name="DATABASE_URL" value="sqlite://i@i/var/test.db" /> | ||
<env name="KERNEL_CLASS" value="\Ibexa\Tests\Integration\AdminUi\AdminUiIbexaTestKernel" /> | ||
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0&max[direct]=0&verbose=0"/> | ||
</php> | ||
<extensions> | ||
<extension class="DAMA\DoctrineTestBundle\PHPUnit\PHPUnitExtension" /> | ||
</extensions> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ services: | |
public: false | ||
|
||
Ibexa\AdminUi\Util\: | ||
resource: "../../../lib/Util" | ||
resource: "../../../../lib/Util" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
<?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\AdminUi; | ||
|
||
use DAMA\DoctrineTestBundle\DAMADoctrineTestBundle; | ||
use Hautelook\TemplatedUriBundle\HautelookTemplatedUriBundle; | ||
use Ibexa\Bundle\AdminUi\IbexaAdminUiBundle; | ||
use Ibexa\Bundle\ContentForms\IbexaContentFormsBundle; | ||
use Ibexa\Bundle\Rest\IbexaRestBundle; | ||
use Ibexa\Bundle\Search\IbexaSearchBundle; | ||
use Ibexa\Bundle\User\IbexaUserBundle; | ||
use Ibexa\Contracts\Migration\Metadata\Storage\MetadataStorage; | ||
use Ibexa\Contracts\Migration\MigrationStorage; | ||
use Ibexa\Contracts\Test\Core\IbexaTestKernel; | ||
use Ibexa\Migration\Metadata\Storage\InMemoryMetadataStorage; | ||
use Ibexa\Migration\Storage\InMemoryMigrationStorage; | ||
use Ibexa\Tests\Integration\AdminUi\DependencyInjection\Configuration\IgnoredConfigParser; | ||
use Knp\Menu\FactoryInterface; | ||
use Lexik\Bundle\JWTAuthenticationBundle\Services\JWTTokenManagerInterface; | ||
use Swift_Mailer; | ||
use Symfony\Component\Config\Loader\LoaderInterface; | ||
use Symfony\Component\Config\Resource\FileResource; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\DependencyInjection\Definition; | ||
use Symfony\Component\HttpKernel\Fragment\EsiFragmentRenderer; | ||
use Symfony\WebpackEncoreBundle\Asset\EntrypointLookupCollection; | ||
use Symfony\WebpackEncoreBundle\Asset\TagRenderer; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
final class AdminUiIbexaTestKernel extends IbexaTestKernel | ||
{ | ||
public function registerBundles(): iterable | ||
{ | ||
yield from parent::registerBundles(); | ||
|
||
yield new IbexaRestBundle(); | ||
yield new IbexaUserBundle(); | ||
yield new IbexaAdminUiBundle(); | ||
yield new IbexaContentFormsBundle(); | ||
yield new IbexaSearchBundle(); | ||
yield new DAMADoctrineTestBundle(); | ||
yield new HautelookTemplatedUriBundle(); | ||
} | ||
|
||
public function registerContainerConfiguration(LoaderInterface $loader): void | ||
{ | ||
parent::registerContainerConfiguration($loader); | ||
|
||
$loader->load(static function (ContainerBuilder $container): void { | ||
$container->setParameter('locale_fallback', 'en'); | ||
}); | ||
|
||
$loader->load(dirname(__DIR__, 2) . '/src/bundle/Resources/config/services.yaml'); | ||
|
||
$loader->load(__DIR__ . '/Resources/ibexa.yaml'); | ||
|
||
$loader->load(static function (ContainerBuilder $container): void { | ||
self::configureIbexaDXPBundles($container); | ||
self::configureThirdPartyBundles($container); | ||
|
||
self::loadRouting($container, __DIR__ . '/Resources/routing.yaml'); | ||
}); | ||
} | ||
|
||
private static function loadRouting(ContainerBuilder $container, string $filePath): void | ||
{ | ||
$container->loadFromExtension('framework', [ | ||
'router' => [ | ||
'resource' => $filePath, | ||
], | ||
]); | ||
$container->addResource(new FileResource($filePath)); | ||
} | ||
|
||
private static function configureIbexaDXPBundles(ContainerBuilder $container): void | ||
{ | ||
self::configureMigrationsBundle($container); | ||
|
||
$container->setParameter('form.type_extension.csrf.enabled', false); | ||
$container->setParameter('ibexa.http_cache.purge_type', 'local'); | ||
$container->setParameter('ibexa.http_cache.translation_aware.enabled', false); | ||
$container->setParameter('locale_fallback', 'en'); | ||
$container->register('fragment.renderer.esi', EsiFragmentRenderer::class); | ||
|
||
/** @var \Ibexa\Bundle\Core\DependencyInjection\IbexaCoreExtension $kernel */ | ||
$kernel = $container->getExtension('ibexa'); | ||
$kernel->addConfigParser( | ||
new IgnoredConfigParser( | ||
[ | ||
'admin_ui_forms', | ||
'calendar', | ||
'content_create_view', | ||
'content_translate_view', | ||
'content_edit_view', | ||
'design', | ||
'search_view', | ||
'universal_discovery_widget_module', | ||
] | ||
) | ||
); | ||
} | ||
|
||
protected static function getExposedServicesByClass(): iterable | ||
{ | ||
yield from parent::getExposedServicesByClass(); | ||
} | ||
|
||
private static function configureMigrationsBundle(ContainerBuilder $container): void | ||
{ | ||
$container->setDefinition(MetadataStorage::class, new Definition(InMemoryMetadataStorage::class)); | ||
$container->setDefinition(MigrationStorage::class, new Definition(InMemoryMigrationStorage::class)); | ||
} | ||
|
||
private static function configureThirdPartyBundles(ContainerBuilder $container): void | ||
{ | ||
$container->setParameter('fos_http_cache.tag_handler.strict', false); | ||
$container->setParameter('fos_http_cache.compiler_pass.tag_annotations', false); | ||
|
||
self::addSyntheticService($container, Swift_Mailer::class); | ||
self::addSyntheticService($container, JWTTokenManagerInterface::class); | ||
self::addSyntheticService($container, FactoryInterface::class); | ||
self::addSyntheticService($container, TagRenderer::class, 'webpack_encore.tag_renderer'); | ||
self::addSyntheticService( | ||
$container, | ||
EntrypointLookupCollection::class, | ||
'webpack_encore.entrypoint_lookup_collection' | ||
); | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
tests/integration/DependencyInjection/Configuration/IgnoredConfigParser.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?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\AdminUi\DependencyInjection\Configuration; | ||
|
||
use Ibexa\Bundle\Core\DependencyInjection\Configuration\AbstractParser; | ||
use Ibexa\Bundle\Core\DependencyInjection\Configuration\SiteAccessAware\ContextualizerInterface; | ||
use Symfony\Component\Config\Definition\Builder\NodeBuilder; | ||
|
||
final class IgnoredConfigParser extends AbstractParser | ||
{ | ||
/** @var array<string> */ | ||
private array $keys; | ||
|
||
/** | ||
* @param array<string> $keys | ||
*/ | ||
public function __construct(array $keys) | ||
{ | ||
$this->keys = $keys; | ||
} | ||
|
||
public function addSemanticConfig(NodeBuilder $nodeBuilder): void | ||
{ | ||
foreach ($this->keys as $key) { | ||
$nodeBuilder->variableNode($key)->defaultNull()->end(); | ||
} | ||
} | ||
|
||
/** | ||
* @param array<string, mixed> $scopeSettings | ||
*/ | ||
public function mapConfig(array &$scopeSettings, $currentScope, ContextualizerInterface $contextualizer): void | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ibexa: | ||
system: | ||
default: | ||
languages: [ eng-GB, ger-DE ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ibexa.user: | ||
resource: '@IbexaUserBundle/Resources/config/routing.yaml' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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\AdminUi; | ||
|
||
use Ibexa\Contracts\Test\Core\Translation\AbstractTranslationCase; | ||
|
||
final class TranslationTest extends AbstractTranslationCase | ||
{ | ||
public static function provideConfigNamesForTranslation(): iterable | ||
{ | ||
yield ['ibexa_admin_ui']; | ||
} | ||
} |
Oops, something went wrong.