Skip to content

Commit 8e450f6

Browse files
authored
IBX-1589: Renamed Extension ezrichtext to ibexa_fieldtype_richtext (#5)
For more details see https://issues.ibexa.co/browse/IBX-1589 * Renamed Extension ezrichtext to ibexa_fieldtype_richtext * [Tests] Aligned tests with the extension name change
1 parent 947f805 commit 8e450f6

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

src/bundle/DependencyInjection/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Configuration extends SiteAccessConfiguration
2323
*/
2424
public function getConfigTreeBuilder()
2525
{
26-
$treeBuilder = new TreeBuilder('ezrichtext');
26+
$treeBuilder = new TreeBuilder(IbexaFieldTypeRichTextExtension::EXTENSION_NAME);
2727

2828
$rootNode = $treeBuilder->getRootNode();
2929

src/bundle/DependencyInjection/IbexaFieldTypeRichTextExtension.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
*/
2424
class IbexaFieldTypeRichTextExtension extends Extension implements PrependExtensionInterface
2525
{
26+
public const EXTENSION_NAME = 'ibexa_fieldtype_richtext';
27+
2628
const RICHTEXT_CUSTOM_STYLES_PARAMETER = 'ezplatform.ezrichtext.custom_styles';
2729
const RICHTEXT_CUSTOM_TAGS_PARAMETER = 'ezplatform.ezrichtext.custom_tags';
2830
const RICHTEXT_ALLOY_EDITOR_PARAMETER = 'ezplatform.ezrichtext.alloy_editor';
@@ -32,7 +34,7 @@ class IbexaFieldTypeRichTextExtension extends Extension implements PrependExtens
3234

3335
public function getAlias()
3436
{
35-
return 'ezrichtext';
37+
return self::EXTENSION_NAME;
3638
}
3739

3840
/**
@@ -143,7 +145,7 @@ private function prependEzPublishConfiguration(ContainerBuilder $container): voi
143145
private function prependEzRichTextConfiguration(ContainerBuilder $container): void
144146
{
145147
$richTextExtensionConfigFile = realpath(__DIR__ . '/../Resources/config/prepend/ezrichtext.yaml');
146-
$container->prependExtensionConfig('ezrichtext', Yaml::parseFile($richTextExtensionConfigFile));
148+
$container->prependExtensionConfig(self::EXTENSION_NAME, Yaml::parseFile($richTextExtensionConfigFile));
147149
$container->addResource(new FileResource($richTextExtensionConfigFile));
148150
}
149151

tests/bundle/DependencyInjection/Configuration/Parser/FieldType/RichTextTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ class RichTextTest extends AbstractParserTestCase
3434
private function getExtensionsConfig(): array
3535
{
3636
if (null === $this->extensionsConfig) {
37-
foreach (['ezrichtext', 'ezpublish'] as $extensionName) {
37+
$extensionNames = [IbexaFieldTypeRichTextExtension::EXTENSION_NAME, 'ezpublish'];
38+
foreach ($extensionNames as $extensionName) {
3839
$this->extensionsConfig[$extensionName] = Yaml::parseFile(
39-
__DIR__ . "/../../../Fixtures/{$extensionName}.yaml"
40+
dirname(__DIR__, 3) . "/Fixtures/{$extensionName}.yaml"
4041
);
4142
}
4243
}

tests/bundle/DependencyInjection/IbexaFieldTypeRichTextExtensionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ protected function getContainerExtensions(): array
2626
public function testRichTextConfiguration(): void
2727
{
2828
$config = Yaml::parse(
29-
file_get_contents(__DIR__ . '/Fixtures/ezrichtext.yaml')
29+
file_get_contents(__DIR__ . '/Fixtures/ibexa_fieldtype_richtext.yaml')
3030
);
3131
$this->load($config);
3232

@@ -123,7 +123,7 @@ public function testPrepend(): void
123123
public function testCheckingInlineCustomTagsInToolbars(string $toolbarName, ?string $expectedException): void
124124
{
125125
$config = Yaml::parse(
126-
file_get_contents(__DIR__ . '/Fixtures/ezrichtext.yaml')
126+
file_get_contents(__DIR__ . '/Fixtures/ibexa_fieldtype_richtext.yaml')
127127
);
128128
$config['custom_tags']['video']['is_inline'] = true;
129129
$this->container->setParameter('ezpublish.siteaccess.list', ['admin_group']);

0 commit comments

Comments
 (0)